[PlayQueue] Fix incorrect UI states of PlayQueue items #12922
+3
−3
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 is it?
Description of the changes in your PR
onNext()is called afteronSubscribe()when creating aPlayQueueAdapter. For that reason the last broadcasted event is applied to the UI state although it is already reflected in the PlayQueue that was used to initialize the adapter.This is the intended behavior of the previously used event broadcaster of the type
BehaviorSubject<>. The broadcaster's type was changed toPublishSubject<>which does not emit the last event afteronSubscribe().Before/After Screenshots/Screen Record
For screen records of the bugged behaviour, see #9669
Screen_recording_20251220_181830.webm
Review request
Help me identify why a
BehaviorSubjectwas used in the first place. Is there a place where its functionality is needed?Fixes the following issue(s)
Fixes #9669
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence