Repository navigation
Conversation
Author
|
Priority clarification after updating the description: could this be considered P2 (reliability with a workaround) rather than the current P3? The deferred real-store regression demonstrates A → pending B → A ending on B, contrary to the final explicit profile selection. Waiting for B and selecting A again is a workaround. Four deleted production lines move the existing no-op decision behind pending activation, preserving the settled no-op. This is limited to legacy profile activation ordering, not a universal switching claim. The PR body now includes concise reproduction, the protected invariant, exact-head verification commands and explicit test limits. I am not requesting P1/P0; the severity decision remains with maintainers. |
12 of 19 tasks
ctaylor86
force-pushed
the
fix/desktop-profile-switch-last-intent
branch
from
September 11, 2026 16:14
260a20f to
4ce4d4f
Compare
This branch has not been deployed
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.
What does this PR do?
If profile A is active, the user starts switching to B, then selects A again before B finishes connecting, Desktop can end on B despite the user's final selection being A. The “already active” fast path runs before the pending-switch mutex, so the final A request is discarded.
Delete that redundant pre-mutex check. The existing check after the mutex still avoids unnecessary work once earlier activation has settled. Production code changes by four deleted lines; no new state or coordinator is introduced.
Why it matters / suggested P2: this is a reproducible wrong-profile activation race, not cosmetic flicker. The workaround is to wait for B to finish and select A again. It affects the legacy profile activation path; this PR does not claim universal registry-switch ordering or failure-reporting coverage.
Related Issue
Related to #90149. The current patches for #105139 and #102673 do not change this pre-mutex early return. This is a separate, independently mergeable legacy activation-ordering fix.
Type of Change
Changes Made
apps/desktop/src/store/profile.ts: remove the four-line early return before waiting for an in-flight switch.apps/desktop/src/store/profile-last-intent.test.ts: drive A → pending B → A through real profile/gateway/session stores; assert final profile, connection and socket identity, and the settled no-op behavior.How to Test
work(B), notdefault(A). After: the final A request waits and then wins; a subsequent settled A request remains a no-op.Run against head
4ce4d4fa1769faa55eeecbe37929e584213a7a0e:Final-head verification: 35 tests / 4 files passed, plus all three Desktop TypeScript projects and
git diff --check. The new behavioral regression was independently run against the unchanged base and failed withworkinstead ofdefault.Transport/UI effects are synthetic; profile, gateway and session stores are real. Production build was not rerun for this store-only patch. Failed legacy dials retain their existing rejection behavior; unrelated registry disposal/supersession behavior is unchanged.
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/A (inline behavior comments updated; no new setup required)cli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
The regressions above were run against the baseline and the reviewed fix.
git diff --checkand the public-data/secret scan passed. Independent code review and isolated UI review were completed before publication. Private workspace screenshots are intentionally omitted; no user data or configuration is included.No new dependencies, configuration keys or model-tool schemas. No Python source changes; the full Python suite was not run and its checklist item remains unchecked. macOS was executed; Windows/Linux were considered but not run locally. Live CI results are available in the PR checks rather than frozen here.