fix(sessions): stop auto-navigating every device on session_ready - #1032
Merged
Conversation
The streamer broadcasts session_ready to every paired device, and the frame names no initiator. The root listener pushed into the session on every one of them, so starting a session on one device yanked every other device into it. The only guard was a same-device duplicate suppressor, which a device that started nothing always fell through. Every screen that starts a session already navigates itself, so the listener now only logs. Closes #957
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
The streamer broadcasts
session_readyto every paired device, and the frame names no initiator.The root listener in
app/_layout.tsxpushed into the session on every one of them, so starting a session on one device yanked every other device into it.The only guard,
shouldSkipAutoNav, was a same-device duplicate suppressor, which a device that started nothing always fell through.Every screen that starts a session already navigates itself (
app/session/new.tsx, conversation resume and fork, and the pending screen's exact-id listener), so the listener now only logs.Behaviour change
A user who leaves the "starting" screen before the PTY is ready is no longer pulled back into the session when it becomes ready.
Tests
auth-gate-review-resume.test.tsxfails onmain(one navigation recorded) and passes with the fix.AuthGatemakes.Follow-up
Nothing reads
shouldSkipAutoNavany more, so the remaininglib/sessionNavGuard.tscalls write state that has no reader.The comment at
app/_layout.tsx:356is inaccurate for the same reason.Both are left for a separate PR to keep this one small.
Closes #957