Skip to content

fix(mac): false "not connected" error on every cold launch - #460

Merged
SergeSerb2 merged 1 commit into
mainfrom
surgecode/launch-connection-grace
Aug 3, 2026
Merged

fix(mac): false "not connected" error on every cold launch#460
SergeSerb2 merged 1 commit into
mainfrom
surgecode/launch-connection-grace

Conversation

@SergeSerb2

Copy link
Copy Markdown
Owner

Problem

Every app launch showed a "not connected" error banner while the app was still booting normally. MultiDeviceModel.start() (added in the settings-mesh work, 2c069ae09) fired syncGlobalSettings() in a parallel task at the same instant it started the local backend. The settings RPC reached LiveBackend.settings() before the sidecar process had spawned, threw LiveBackendError.notConnected, and AppModel.report(_:) rendered it as an error banner on the empty-state view / composer. The race loses every time — a Node sidecar boot takes seconds, the failing guard takes microseconds — and nothing cleared lastError when the connection subsequently reached .ready.

Fix

  • MultiDeviceModel.start() no longer loads settings eagerly. The first sync rides onConnectionReady (installed by installGlobalSettingsCoordinator on every model), which is the earliest moment it can succeed. Same for keybindings.
  • AppModel.loadSettings() treats a notConnected failure as the retryable transient it is (the coordinator reloads on ready) instead of reporting it — covers loads racing a reconnect as well.
  • New Error.isNotConnected helper covers both shapes (LiveBackendError.notConnected, T3Error.notConnected).

Tests

  • New: "a pre-connect settings load stays silent instead of raising a banner".
  • New: "a settings load that fails for a real reason still reports".
  • Full mac suite: 1107 tests in 174 suites pass; pnpm run verify pass.

🤖 Generated with Claude Code

…ected" banner

MultiDeviceModel.start() kicked off a settings/keybindings sync in a parallel
task the instant it started the local backend. That load reached
LiveBackend.settings() before the sidecar had even spawned, threw
notConnected, and report() turned the guaranteed-to-lose race into a visible
error banner on every cold launch — while the toolbar pill correctly said
"Launching Server…". Nothing cleared the banner once the connection came up.

Drop the eager sync: the global-settings coordinator already reruns the sync
from every model's onConnectionReady, which is the first moment it can
succeed. Treat a notConnected settings load as the retryable transient it is
instead of reporting it, so mid-reconnect loads stay quiet too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@SergeSerb2 SergeSerb2 added the size:XS Tiny internal, documentation, or narrowly scoped fix label Aug 3, 2026
@SergeSerb2
SergeSerb2 merged commit 2722b48 into main Aug 3, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS Tiny internal, documentation, or narrowly scoped fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant