Repository navigation
Conversation
A play was only closed when the next track started, so the last song of a session (the queue ran out, or the app was closed mid-song) never produced TrackEnded and never reached the local history. On quit the player actor now closes the open play and hands its TrackEnded back from shutdown(); Services::shutdown records it before flushing the history, since the broadcast listener no longer runs at that point.
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.
The last song of a session never reached the local play history.
A play is only closed when the next track starts. When the app quits mid song (or after the queue ran out), nothing closed it, and the TrackEnded event would have arrived after the history was already flushed, since the broadcast listener no longer runs at that point.
Now on quit the player actor closes the open play and returns its TrackEnded from
PlayerHandle::shutdown(), andServices::shutdownrecords it (local plays only) before saving the history.New test
quitting_ends_the_song_still_playing;cargo test --locked -p sf-player -p sf-servicesand the release build pass.