Repository navigation
fix: speaker recovers from the wrong song, stalls and duplicate tabs - #74
Merged
Merged
Conversation
Two incidents in The Work Boys on 2026-10-15, with an iPhone as the speaker: the next song played over the current one until a pause and play, and a song skipped to played silently while showing as playing. - A device on another song than the room at the same revision now loads the room's song. Before, only a new revision corrected it, which is why pause then play fixed it. The gapless handoff (the next song in the last 10s of the room's) is left alone. - A stream that says it's playing but hasn't moved for 10s is reloaded where it was; after two in a row the speaker reports an error. - Tabs of one browser share a device ID, so the newest to play tells the others to go quiet over a BroadcastChannel. - begin() clears the loaded songs, since it puts silence in both elements: starting while already playing could play silence and skip songs. - The server logs speaker claims and releases, commands, song changes and reports (stale ones marked), so the next incident can be read from logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happened
On 2026-10-15 in The Work Boys, with a friend's iPhone (Chrome, iOS 26) playing to a Bluetooth speaker:
The exact device actions couldn't be reconstructed, and the server didn't log playback events. So this PR fixes the client-side gaps that lead to those symptoms, and adds logging.
Changes
offSong()notices when a device is on another song than the room at the same revision, andapplyloads the room's song. Before, only a new revision corrected it, which is why pause then play fixed it. The gapless handoff (the next song in the last 10s of the room's) is left alone.error. Reloading back to the stall point doesn't count as progress.BroadcastChannel. If the other tab played as a different device, it releases instead.begin()clearscurItem/preItem, since it puts silence in both elements. Starting while already active could play silence and skip songs.docs/player-mode.md.Testing
go test ./internal/playback ./internal/httpapipassoffSongcases), oxlint and tsc clean🤖 Generated with Claude Code