Files
pipelines/app/notes/multiple-servers.md
T

6.3 KiB

Multiple servers and double-back home exit

User selected automatic fallback: named logical servers each have ordered preferred/backup addresses. Switching logical servers is explicit, never an automatic response to a network failure. User also requested two Android Back presses at home to exit; details/dialogs still use one normal pop.

Item Source Verification Landing Deployment
Immutable saved profiles/migration 289a971b + afb97c75 Roundtrip, ordered aliases, validation, failed writes, catalog-reset binding Merged main; ancestry verified Web + APK 29880125 verified
Ordered socket fallback b2e5606c 22 transport tests; bounded connect, cancellation, stale callbacks, no mutation replay Merged main; ancestry verified Web + APK 29880125 verified
Per-profile sign-in and trusted origins ae72e0fc + b499da30 30 focused tests; aliases share only explicitly trusted cookies; sign-out and async login races isolated Merged main; ancestry verified Web + APK 29880125 verified
Native/root/settings integration b499da30 Root switch/dispose/reset, same-profile backup and cache-isolation regressions; full suite green Main Web + APK 29880125 verified
Stable launch recovery across aliases afb97c75 + b499da30 Original request key survives legacy storage migration and preferred address changes Merged main; ancestry verified Web + APK 29880125 verified
Double-back home exit 4e6771aa + b499da30 First Android root Back hints; second within 2s falls to platform; navigation/dialogs/expiry clear window; iOS/web unaffected Merged main; ancestry verified Web + APK 29880125 verified

Behavior and preservation

  • Settings → Servers: add/edit/remove named configurations, one address per line in preferred order; explicitly select a different server.
  • Root disposes the previous app/socket before activating the new credential namespace, resets routes and remounts feature state. Alias fallback retains the same logical server identity and never replays outstanding/queued mutations.
  • Cookie, chat draft/instructions/read marks, workspace and notification/dismissal storage are isolated per server. Existing original local data stays with the migrated original server; legacy keys are retained for rollback.
  • Legacy credential identity is bound before connection and cannot be rebound to another server merely by deleting the catalog. The original endpoint pointer is preserved solely to recover old pending-launch keys, never as a network alias.
  • Browser sockets stay on their page origin. Selecting another browser server opens its page; browser Back/reload reconciles selection to the actual origin. Native builds provide automatic primary/backup address fallback.
  • Explicit ws:// LAN profiles are allowed by Android, with cleartext/trusted-link warnings. No TLS downgrade, server discovery or cross-profile cookie forwarding.

Acceptance evidence

  • Full tool/check_full.sh: analyze clean; 1,833 tests pass, including the native-root same-profile backup regression, selection/cookie-reset regression, address migration, pending-intent preservation and double-back exit coverage.
  • Browser normal-app profile flow passes 8 checks/5 captures on each host: build/server-profiles-final-material/, build/server-profiles-final-cupertino/. Covers existing-address migration, alias editing, add without auto-switch, reload, cross-origin page navigation, Back restoring actual selection, removal.
  • Browser discovery: a temporary loading MaterialApp reset deep-link URLs before the real Router mounted. Loading no longer owns an App/Navigator.
  • Full suite caught two regressions and they were corrected: the isolated gate test explicitly disposes its now-time-bounded connection before teardown; the explicit openSearch API still restores its return route, while the Search tab participates in home double-back. All 32 focused application regressions pass.
  • Read-only security review identified three concrete issues (legacy identity rebinding, browser selection mismatch, migrated pending-launch key changes); fixes were re-reviewed with no remaining findings in that scope.
  • No backend edits, production chat/run mutations, device use or phone installation. Actual Android device behavior remains unverified.

Deployment

  • ./install --web-port 8083 succeeded. Unrelated scratch service on 8082 was preserved. Checked no executing runs/active chats, then restarted the managed server; its banner identifies b499da30 and the original database/artifact paths and OpenCode endpoint. History remains 186 runs.
  • Existing public web URLs retained by an atomic installed-bundle copy; rollback app/build/web-before-multi-server-1792807671/.
  • Installation/binary/web/APK rollback backup: ~/.local/share/pipelines/backups/multi-server-20261024-030635/.
  • Previous feature browser regressions: 12 navigation checks/9 captures in build/server-profiles-navigation-regression/; 17 chat/stage-debug checks/10 captures in build/server-profiles-chat-stage-regression/.
  • Reran 8 profile checks/5 captures against the installed Docker bundle: build/server-profiles-installed-material/.
  • Authenticated JS downloads match the installed bundle at localhost:8083 and existing public HTTPS ports 8443/8096; all three reject unsigned asset requests. JS SHA256: 601a23c1cba4bf55e483c76b555ec227d7bbe4ed7761849121dfc80ed364fb71.
  • ./install --apk succeeded: build 29880125 (0.1.29880125), 65,398,518 bytes; 417.5 seconds assembleRelease. APK SHA256: 95bd8d9ca854066afe097136300108bf28eabc74032379d76ecd6836fa1f1ae9.
  • APK matches current source/argument cache b1bc61a4a068aadc6fd9; ZIP integrity and ARM64 payload checked. Signature verification passes and matches the prior debug signer, preserving update compatibility.
  • Installer and existing public feeds published atomically. Full authenticated APK downloads and version metadata verified at localhost:8083 and public HTTPS 8443/8096; unauthenticated APK requests remain rejected.
  • APK rollback: app/build/updates-before-multi-server-29880125/ and app/build/web/updates-before-multi-server-29880125/.
  • Download: https://alans-macbook-pro.tail6bf4dc.ts.net:8443/updates/pipelines.apk. No device installation or on-device verification was performed.