Skip to content

fix: reconcile client state on websocket connect#36

Merged
paolino merged 3 commits into
mainfrom
fix/state-reconcile
Jul 4, 2026
Merged

fix: reconcile client state on websocket connect#36
paolino merged 3 commits into
mainfrom
fix/state-reconcile

Conversation

@paolino

@paolino paolino commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a setSession websocket command carrying the client's full current tracks and definitions.
  • Replaces server tracks/definitions from that payload while preserving server slot capacity, persists both stores, and broadcasts the new snapshot.
  • Sends the current editor state on websocket open before connected playback transitions can emit activate/silence commands.

Root Cause

The served UI booted from the frontend seed while the backend session loaded from empty stores. Playback commands could therefore reference track IDs that existed in the client but not on the server, producing PlaybackTrackMissing.

Validation

  • nix develop -c just unit Riptide.Protocol
  • nix develop -c just unit Riptide.Server
  • nix develop .#frontend --command just test
  • ./gate.sh
  • Served UI smoke with an empty temporary state directory: no Command failed or PlaybackTrackMissing in rendered DOM/server log.

@paolino paolino marked this pull request as ready for review July 4, 2026 12:44
@paolino paolino merged commit de63bd7 into main Jul 4, 2026
4 checks passed
@paolino paolino deleted the fix/state-reconcile branch July 4, 2026 12:45
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