Repository navigation
fix(studio): refresh thread IDs after subscribing - #2619
Merged
Merged
Conversation
Close the render-to-effect notification gap that can leave thread IDs stale after account quarantine. Add a deterministic layout-effect regression and verify subsequent notifications. Fixes #2376 Co-authored-by: Mecatl <[email protected]>
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 #2376.
useThreadSessionIds()read its initial snapshot during render, then installed its event listeners in a passive effect without rereading storage. A thread registered between those steps could leave the ID set empty even thoughuseThreadMap()already showed the thread—the split snapshot reported by the account-quarantine flake.Refresh the IDs immediately after subscribing. This closes the missed-notification window without retries, sleeps, or timeout changes.
Add a deterministic regression that registers a thread from
useLayoutEffect, before passive subscriptions attach, and checks both the initial recovery and subsequent notifications. Before the fix, the map assertion passed while the ID assertion failed with[].Verification
--maxWorkers=4.task testpassed.task lintandtask test:racepassed.The initial unrestricted web run, concurrent with the full Go suite, hit seven 5-second test timeouts. The bounded web rerun after Go finished passed without changing any timeout settings.
API compatibility
No wire, Go API, or stored-data schema changes; no API major or feature identifier changes. The hook now observes the current user-scoped state when its subscription attaches. No client upgrade is required.