Repository navigation
fix(watch-party): stop showing refused socket messages as a party error - #542
Conversation
When the room returned to its lobby at the end of an item, a state report
already in flight for the finished session came back as a bad_request
error ("watch together session is not attached"). The session showed it as
the party's error banner, which stayed until the socket next reconnected.
Trace bad_request errors instead of showing them. They answer a message
this client sent and the viewer cannot act on them; the web client only
logs them too. Other error codes still surface.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesWatch Party socket errors
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to A refusal during pending attachment remains visible, while a refusal after termination cannot replace the lobby error. No material user-facing regression is established; normal Apple build and test validation remains appropriate. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
A player waiting for its attachment only sends attach_session, so a bad_request then means the server keeps refusing the attach, and the party will not sync until it stops. Show that refusal as before; trace the others. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Problem
Closes #541
Related issue: #541
When a Watch Party item finishes, the Apple TV can show "watch together session is not attached" in the lobby, and the message stays until the room socket next reconnects. It is the server refusing a report the Apple TV sent for the session that just ended, which raced the room's return to its lobby. The viewer cannot act on it. Affects iOS, tvOS, and macOS, which share
WatchPartySession.Approach
WatchPartySession.receivenow tracesbad_requesterrors instead of storing them inerrorMessage. The server usesbad_requestfor every message from this client that it refuses, and the web client only logs these.connection_replacedstill ends the party, and any other code still shows as before.I considered hiding only this one message, but the same race also produces other refusals (an attach that arrives after the lobby transition, for example), and matching on a server error string would be brittle. Clearing the banner on the lobby snapshot would not work: the refusal can arrive after the snapshot. User actions do not depend on the banner: transport controls are already gated by the room's permissions, and
send()drops messages once the phase or selection changes.Server and Android coordination: Android shows these refusals as a short toast and likely flashes the same message. A server-side change that stops answering reports for a session that is no longer attached would cover every client; that is left as a follow-up.
Validation
Apple regressionworkflow builds and tests it on macOS.receiveis private and driven by the socket, and no session-level socket harness exists; a test of the error-code list alone would only restate the code.Risks
A persistent server-side refusal (for example a failed
attach_session) no longer shows its raw server text in a banner. It is still traced in debug builds, and the web client has never shown these either.Checklist
AI Disclosure
bad_request, and checked whether any user action relied on the banner, parity with the web and Android clients, and the Swift control flow. It found no blocking issue. Its suggestion to keep the comment inside the branch was applied; its suggestion to stop the server from answering stale-session reports is noted above as a follow-up.🤖 Generated with Claude Code
Note
Fix Watch Party showing refused socket messages as a party error
Adds a dedicated branch for server
bad_requesterrors in WatchPartySession.swift. Abad_requestreceived while an adapter exists and attachment is unconfirmed still sets the user-visibleerrorMessage; otherwise it is written only to the debug trace. Other error codes keep their existing handling.Risk:
bad_requestresponses after attachment confirmation, or with no adapter, no longer populateerrorMessage.Macroscope summarized 3308139.