fix(desktop): scope dedicated remote resumes correctly - #85932
Closed
plcunha wants to merge 1 commit into
Closed
Conversation
This was referenced Aug 14, 2026
Collaborator
19 tasks
Collaborator
|
Note: this PR also touched |
OutThisLife
added a commit
that referenced
this pull request
Aug 14, 2026
…0.20.1 sharedPrimaryRoute() inferred "served by the shared primary backend" from the mere presence of connection.profile. But pooled backends (a local named profile, or a per-profile remote override) also carry `profile` so their WebSocket URL mints against the right backend. Both descriptors looked the same, so ensureGatewayForProfile() took the shared-primary branch for a pooled profile and never dialed its socket — Desktop stayed on the default profile's socket even though the sidebar (REST) listed the right sessions. Regression from #85665 (d16e236). Tag only the true shared-primary descriptor with an explicit `sharedPrimary: true` marker in ensureBackend() and check that marker instead of `profile`. Covers both the local-pool and remote-override routes — the whole bug class, not one path. Test asserts both sides of the invariant: a { profile, sharedPrimary: true } descriptor activates the primary socket without dialing, and a pooled descriptor carrying { profile } dials its own exact WebSocket URL. Supersedes #85750, #85778, #85932 Fixes #85777 Co-authored-by: Tigrannnnnnn <122704900+Tigrannnnnnn@users.noreply.github.com> Co-authored-by: Don Tuttle <11698271+wdon@users.noreply.github.com> Co-authored-by: plcunha <145560011+plcunha@users.noreply.github.com>
14 tasks
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.
Summary
Fixes Desktop sessions that load their transcript from a per-profile remote but fail WebSocket resume with
session not found.A Desktop profile alias and a backend-internal profile are not always the same thing:
This change adds an explicit
sharedPrimaryroute discriminator, uses it for socket selection, and translates Desktop ownership into the correctsession.resumeRPC scope across every resume entry point.Fixes #85834.
Root cause
HermesConnection.profilewas overloaded with two meanings:Per-profile remote descriptors carry their Desktop alias, but the remote backend may expose only its own
defaultprofile. The renderer forwarded the alias insession.resume; the correctly selected remote backend then rejected it as an unknown profile. The same overloaded field also made dedicated pooled descriptors look like shared-primary routes.RED proof
Before the implementation, the new routing tests failed:
The failing cases pin both required semantics: keep scope for an explicitly shared-primary descriptor and omit a Desktop alias for a dedicated descriptor.
Changes
sharedPrimary: true;profile;gatewayRpcProfile()to translate Desktop owner aliases into backend RPC scope;Widening audit
Searched all Desktop
session.resumecallers. The profile-bearing paths are covered:Profile-free test paths and new-session creation are unchanged.
Related work: #85750 and #85778 identify the same descriptor-field ambiguity for socket selection. This PR carries the explicit discriminator through that routing decision and the inner
session.resumepayload, which is the remaining failure observed when the remote socket itself is correct.Verification
Safety
No session data, credentials, hostnames, or connection URLs are included. The change is renderer/Electron routing only; backend storage and API contracts are unchanged.