Repository navigation
fix(watch-party): stop displaced connections from reconnecting - #1287
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedNext included review available in 22 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (21)
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 |
There was a problem hiding this comment.
Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Problem
Related issue: #1284 (S2)
Companion correction: #1286 handles common suggestion broadcasts. Both PRs target
mainand can merge independently.When another device connects as the same room member, the displaced socket closes without an explanation. The web reconnects and can repeatedly replace the other device.
Approach
Send a terminal v2
connection_replacedframe after the membership transaction commits. The existing socket writer prioritizes and flushes it before closing, with a one-second bound for a blocked peer. Both local takeover and cross-node reconciliation close the captured loser; stale callbacks cannot disconnect the winner.The web retains the active room, pauses displaced playback, explains the takeover and offers explicit rejoin. Guards prevent late socket messages, HTTP selection updates, autoplay and media callbacks from resuming displaced playback. A capability flag and protocol documentation define the signal. V1 keeps its existing close behavior.
Validation
make test-gopassed 156 packages; onlyTestAdminResourceCapabilitiesAndScopefailed on macOS. The unchanged base fails identically because resource reporting is Linux-only.Risks
Older v2 clients that ignore the signal can still reconnect and displace the winner. Apple adoption is tracked in Silo-Server/silo-apple#344 and Android follow-up in Silo-Server/silo-android#355; neither physical native client was tested here. These checks prove controlled socket recovery, not a real network outage. A broken transport can prevent delivery of the terminal frame. Deploy the correction to every API node before relying on it across the cluster. Jellyfin compatibility does not use these sockets.
Checklist
AI Disclosure
gh), Go toolchain,golangci-lint, pnpm/Vitest, Playwright with Chrome, SSH and Docker; repository unslop skill for PR prose.gpt-6-astrafor implementation and independent review agents.