Skip to content

Conversation

@hweihwang
Copy link
Contributor

@hweihwang hweihwang commented Dec 9, 2025

Summary

  • Strengthened multi-node orchestration so presentation, viewport, recording, timer, and voting stay in sync across nodes and late joiners always hydrate current state via Redis Streams.
  • Hardened cluster sweep and shared state cleanup to drop stale presentation/recording/timer/voting entries before notifying rooms, preventing ghost sessions.
  • Improved node failover handling so syncer reassignment, presenter disconnects, and recorder moves remain consistent during node shutdowns or restarts.

Rationale

  • Ensure every collaborative feature survives node changes, reconnects, and late joins without divergence.
  • Keep shared state authoritative in Redis so any node can serve correct context immediately.
  • Reduce operational risk in clustered deployments by cleaning stale data and making failover deterministic.

Manual Test Cases

  • Presentation: start/stop across nodes; viewport updates reach followers; late joiner sees active presentation; presenter disconnect stops session.
  • Recording: start and stop from different nodes; recorder reconnect preserves metadata; stale recording entries removed on join.
  • Timer: start/pause/resume/extend/reset across nodes; late joiner sees current timer; state cleared when room empties.
  • Voting: start vote, cast votes from multiple nodes, end vote; late joiner sees active vote; state cleared when room empties.
  • Cluster sweep: seed stale presentation/recording/timer/voting entries, run sweep, confirm stale entries removed before room notifications.
  • Node failover: shutdown syncer node and see reassignment; shutdown presenter node and verify stop broadcast; recorder node shutdown reassigns syncer.
  • Restart resilience: restart a peer node and verify shared session state persists and late joiners still get active presentation/timer/vote state.

@hweihwang
Copy link
Contributor Author

hweihwang commented Dec 10, 2025

Currently focus on rebasing and align the logic for Timer and Voting features there, update the progress and description cases above soon

cc @juliusknorr

@hweihwang hweihwang marked this pull request as ready for review December 10, 2025 11:54
@hweihwang
Copy link
Contributor Author

Updated there @juliusknorr !!!

@juliusknorr
Copy link
Member

Thanks, I'll have a look 👍

@juliusknorr juliusknorr added enhancement New feature or request 3. to review labels Dec 10, 2025
@juliusknorr juliusknorr added this to the 1.5.0 milestone Dec 10, 2025
@hweihwang hweihwang linked an issue Dec 11, 2025 that may be closed by this pull request
@hweihwang hweihwang force-pushed the redis-scaling branch 3 times, most recently from 615a4ba to 52ed669 Compare December 11, 2025 11:03
return
} catch (error) {
if (this.#isClientClosedError(error)) {
return
Copy link
Member

Choose a reason for hiding this comment

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

This may hide a critical error, @benjaminfrueh suggested that we may still throw here instead

Copy link
Contributor

Choose a reason for hiding this comment

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

I added console.error in these cases of silent failures of write operations for now.

Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

Re-tested with and without redis and multiple websocket server nodes.

hweihwang and others added 4 commits December 12, 2025 15:55
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
Signed-off-by: Benjamin Frueh <benjamin.frueh@gmail.com>
@juliusknorr juliusknorr merged commit 5174410 into main Dec 12, 2025
31 of 32 checks passed
@juliusknorr juliusknorr deleted the redis-scaling branch December 12, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make socket session state work across multiple websocket nodes

4 participants