fix: address COE verification findings — bell-clear regression, active_view fallback, device_id consistency

- BUG 1: Replace isinstance(active_remote_id, int) guard with _lookup_remote_by_device_id()
  so bell-clear fires correctly when active_remote_id is a UUID string (new format).
  Old code silently skipped the POST for all non-integer active_remote_id values.
  Regression test: test_poll_cycle_fires_federation_bell_clear_for_remote_session_with_uuid

- GAP 4: Add _resolveActiveView(activeView, views) helper in app.js.
  Falls back to 'all' when active_view references a deleted/unknown view name.
  Ready for Phase 2 view-switching code to call at read time.

- ISSUE 6: _createDeviceSelect now uses remotes[i].device_id || String(i) for option
  values instead of always String(i), so session creation routes receive correct device_id.

- ISSUE 9: identity.json written with indent=2 + trailing newline, consistent with
  settings.json and state.json formatting conventions.

- ISSUE 11: Fix state.py module docstring — 'tmux-web muxplex' → 'muxplex'.

- ISSUE 12: Settings panel hidden_sessions checkboxes now use s.sessionKey || s.name
  as the checkbox value (and checked state) so remote sessions are stored in
  device_id:name format, consistent with getVisibleSessions() lookups.
This commit is contained in:
Brian Krabach
2026-04-15 14:42:50 -07:00
parent 70822d8033
commit ab5560a623
7 changed files with 246 additions and 12 deletions
+2 -6
View File
@@ -220,12 +220,8 @@ async def _run_poll_cycle() -> None:
if _federation_client is not None:
active_remote_id = state.get("active_remote_id")
if active_remote_id is not None:
settings = load_settings()
remote_instances = settings.get("remote_instances", [])
if isinstance(active_remote_id, int) and 0 <= active_remote_id < len(
remote_instances
):
remote = remote_instances[active_remote_id]
remote = _lookup_remote_by_device_id(str(active_remote_id))
if remote is not None:
remote_url: str = remote.get("url", "").rstrip("/")
remote_key: str = remote.get("key", "")
key = remote_key