Skip to content

fix(sessions): stop auto-navigating every device on session_ready - #1032

Merged
RonenMars merged 1 commit into
mainfrom
fix/session-ready-no-global-nav
Sep 10, 2026
Merged

fix(sessions): stop auto-navigating every device on session_ready#1032
RonenMars merged 1 commit into
mainfrom
fix/session-ready-no-global-nav

Conversation

@RonenMars

Copy link
Copy Markdown
Owner

Summary

The streamer broadcasts session_ready to every paired device, and the frame names no initiator.
The root listener in app/_layout.tsx 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, 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

  • A new regression test in auth-gate-review-resume.test.tsx fails on main (one navigation recorded) and passes with the fix.
  • A positive control proves the harness observes pushes that AuthGate makes.
  • The neighbouring suites pass: 9 suites, 70 tests.

Follow-up

Nothing reads shouldSkipAutoNav any more, so the remaining lib/sessionNavGuard.ts calls write state that has no reader.
The comment at app/_layout.tsx:356 is inaccurate for the same reason.
Both are left for a separate PR to keep this one small.

Closes #957

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
@RonenMars
RonenMars merged commit 0d7e9ca into main Sep 10, 2026
23 checks passed
@RonenMars
RonenMars deleted the fix/session-ready-no-global-nav branch September 10, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sessions): starting a session on one device force-navigates every other connected device into it

1 participant