Skip to content

fix(watch-party): share suggestion broadcasts across API nodes - #1286

Merged
Quick104 merged 1 commit into
mainfrom
fix/watch-party-suggestion-broadcasts
Sep 22, 2026
Merged

Quick104 merged 1 commit into
mainfrom
fix/watch-party-suggestion-broadcasts

Conversation

@Quick104

@Quick104 Quick104 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1284 (S1)

Companion correction: #1287 handles connection replacement. Both PRs target main and can merge independently.

Suggestion socket frames report different voted_by_me values depending on which API node receives the mutation. Remote delivery also reads the same suggestions once per viewer.

Approach

Read the common suggestion list once per receiving node with local viewers, outside the room mutex, and send it through the existing broadcast helper. Recheck the room and current connections after the query. Both socket protocols retain their payload shape and common voted_by_me=false; authenticated HTTP reads remain personalized.

Validation

  • Regression tests fail with the original cluster handler restored, reproducing duplicate per-viewer queries and stale delivery, and pass with this change. Coverage includes create/delete, votes/unvotes, multiple profiles, both protocols and room/connection changes during a query.
  • Shared development deployment checks of the combined fix(watch-party): make suggestion broadcasts consistent and stop displaced reconnects #1284 implementation passed with one API process and with a second process using the production room service, handlers, authentication, PostgreSQL repository and Redis bus. V1/v2 rows and tallies matched, and HTTP vote state stayed profile-specific.
  • The isolated PR branch passed focused Go race tests for suggestion mutations, query interleavings and both wire protocols, plus the web socket suite.
  • The full pre-PR gate ran on the combined fix(watch-party): make suggestion broadcasts consistent and stop displaced reconnects #1284 implementation. Builds, formatting, vet, changed-line Go lint, web lint, 4,584 web tests and all required repository verification targets passed. make test-go passed 156 packages; only TestAdminResourceCapabilitiesAndScope failed on macOS. The unchanged base fails identically because resource reporting is Linux-only.

Risks

Clients must retain or refresh their own vote membership from HTTP. The socket field remains non-authoritative, as documented. Native adoption is coordinated through Silo-Server/silo-apple#344 and Silo-Server/silo-android#355. Jellyfin compatibility does not use these sockets.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Codex in T3 Code.
  • Tool(s): GitHub CLI (gh), Go toolchain, golangci-lint, pnpm/Vitest, Playwright with Chrome, SSH and Docker; repository unslop skill for PR prose.
  • Model(s): gpt-6-astra for implementation and independent review agents.
  • Involvement: AI-assisted implementation, tests, documentation, deployment verification and PR preparation at the maintainer's direction.
  • Adversarial review: A separate Codex agent traced query counts, mutex ownership, room/connection changes during queries, HTTP personalization and v1/v2 wire behavior. Regression tests were checked against the original implementation. Final source and publication review found no remaining introduced defect or private evidence in the patch.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a284eaa8-b10b-4f20-9b5c-48e9ba54dd4f

📥 Commits

Reviewing files that changed from the base of the PR and between 40bb028 and cf8a99a.

📒 Files selected for processing (6)
  • docs/realtime-api.md
  • internal/api/handlers/watch_together_suggestions_writer_test.go
  • internal/watchtogether/cluster.go
  • internal/watchtogether/service.go
  • internal/watchtogether/suggestion_broadcast_test.go
  • web/src/api/v2/watchTogetherSocket.test.tsx

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T01:08:30.528796Z cf8a99a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Quick104
Quick104 merged commit 06543b5 into main Sep 22, 2026
10 checks passed
@Quick104
Quick104 deleted the fix/watch-party-suggestion-broadcasts branch September 22, 2026 01:24
@Quick104 Quick104 mentioned this pull request Nov 26, 2026
17 tasks
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.

1 participant