fix(desktop): ping only the active connection at startup#196
Merged
Conversation
Startup ping looped over every configured connection to refresh its remote identity, but non-active connections' identity has no UI consumer (app:connections filters the summary to the active connection, and the connection schema carries no user field) — the persisted identity was only used to prewarm an adapter cache that is refreshed anyway when the connection becomes active. Pinging them just added startup network requests and, for an unreachable/misconfigured connection, a WARN on every launch for a connection not in use. Narrow ping() to the active connection only; switching the active connection still re-pings via the settings-save path (reconfigure -> ping), so on-demand identity refresh is preserved. The active connection's first-sync and PAT fallback behaviour is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
huhamhire
added a commit
that referenced
this pull request
Jul 5, 2026
Add a Fixed entry under Unreleased (both EN canonical and ZH mirror) for #196, and soften the "behavior unchanged from 0.9.0" highlight to note the minor startup fix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
At startup,
ConnectionRuntimeController.ping()looped over every configured connection to refresh its remote identity (currentUser) and probeserverVersion. For non-active connections this is wasted work:app:connectionsfilters the summary to the active connection (services/app.ts), and the connection config schema carries nouserfield, so the connection list can't render it either.Meanwhile the cost is real: extra startup network requests to every connection, and — for an unreachable / misconfigured connection (e.g. a TLS cert altname mismatch) — a
adapter ping failedWARN on every launch for a connection that isn't even in use.Change
Narrow
ping()to the active connection only (find(active)+ early return). Because the loop now handles a single connection, the pervasiveisActivebranches collapse (behaviour-equivalent, simpler).Switching the active connection still re-pings the new active one: the settings-save path sets
active_connection_idthen callsreconfigureConnections()→reconfigure()→ping(). So on-demand identity refresh on switch is preserved — no separate on-switch hook needed.The active connection's first-sync trigger and PAT fallback (sync-once-even-if-ping-fails) are unchanged.
Effect
Verification
npx nx typecheck desktopandnpx nx lint desktopboth pass.🤖 Generated with Claude Code