Repository navigation
fix(locallibrary): go on past a queued track that played out before the tick - #276
Merged
Merged
Conversation
…he tick follow_queue caught up with at most one change of the audio player per call. When the queued track had also played out since the last look (a short track, or a slow tick), it moved on to that track but left it showing as playing on an empty player, so a key pressed then, like n, skipped the track after it. It now checks for a finished player after moving on as well. the_queue_plays_on_through_what_goes_wrong relied on the old behaviour by pulling more samples than its tracks hold; it now pulls up to the playing track's duration.
Rust coverageFrom run 523. Both are held to the thresholds in .cargo/config.toml.
|
bnb
approved these changes
Oct 29, 2026
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 and why
The player's
follow_queuecaught up with at most one change of the audio player per call. It either noticed that the player had moved on to the track queued behind the playing one, or that the playing track had finished. When both happened since the last call (a queued track short enough to play out between two ticks, or a slow tick), it moved the queue on to the queued track but left that track showing as playing on an empty player until the next call. A key pressed in that window caught up first and then acted, sonskipped the track after it. This madetui::props::playing_keeps_the_queue_wholefail intermittently ("n from 1 of 4", 3 against 2), depending on which tick the background opener's results landed on.follow_queuenow checks for a finished player after handling the move to the queued track, re-reading why the new track ended if it did, so one call goes on past both. With a single change, nothing differs from before.the_queue_plays_on_through_what_goes_wronghad relied on the old behaviour. To play out the current track it pulled half a second minus the playhead's position, but its 16 kHz tracks last a quarter second, so the pull also played out the track opened ahead. It now pulls up to the playing track's actual duration, and its assertion that the player goes on to the track opened ahead is as strict as before.How it was tested
a_tick_after_the_queued_track_played_out_goes_on_past_itplays out the playing track and the queued one with no tick in between, then checks that one tick goes on to the third. It fails without the fix.playing_keeps_the_queue_wholeandthe_queue_plays_on_through_what_goes_wrongalso passed 100 and 40 runs with random seeds.cargo fmt --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo nextest run -p locallibrary -p locallibrary-cliandtools/hegel-coverage.shall pass.Checklist
apps/locallibrary/CHANGELOG.mdhas a line under Unreleased, if people using it will noticedocs/and--helpstill say what the code does (apps/locallibrary/docs/rpc/too, for a sidecar change)