Repository navigation
fix: prompt state swaps accounts instantly on owner transition - #12314
Merged
Merged
Conversation
Cross-review follow-up: ownerProvider changes keyed the STORAGE per account, but cached isVisible/current stayed until the next question or flag reload. Both managers now expose ownerDidChange(); DesktopHomeView's owner-keyed task (the established transition seam) calls it on every switch, and RatingPromptManager also observes .userDidSignOut for the sign-out leg. The rating manager clears thank-you and recomputes for the new owner's keys; the remote engine drops the slot (no resolution written), re-evaluates, and refetches. Tests: two new PromptStateAccountScopingTests drive ownerDidChange with a VISIBLE prompt — armed rating bar disappears for account B and returns for A; a remote banner survives the switch unresolved and B's dismissal never sticks to A. Prompt suites 25/25. Failure-Class: none
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.
Why
Follow-up to #12312 (per-account prompt state): storage was owner-scoped, but the cached
isVisible/currentpublished state persisted across an account switch until the next question or flag reload.What
RatingPromptManager.ownerDidChange()(clears thank-you, recomputes from the new owner's keys) andRemotePromptEngine.ownerDidChange()(drops the slot without writing a resolution, re-evaluates, refetches). DesktopHomeView's owner-keyed.task(id: currentOwnerId)— the app's established owner-transition seam (same pattern as the chat-first capability task) — invokes both on every transition; the rating manager additionally observes.userDidSignOutfor the sign-out leg.Verification
Two new
PromptStateAccountScopingTestsexercise the transition with a VISIBLE prompt and no manual flag reload or extra question: the armed rating bar disappears the moment the owner flips to B and returns when it flips back to A; a visible remote banner survives the switch unresolved, B's dismissal doesn't stick to A. All prompt suites 25/25; swift build clean.Failure-Class: none