Skip to content

[PlayQueue] Fix incorrect UI states of PlayQueue items#12922

Merged
TobiGr merged 1 commit intoTeamNewPipe:release-0-28.1from
TobiGr:enqueue-ui
Jan 7, 2026
Merged

[PlayQueue] Fix incorrect UI states of PlayQueue items#12922
TobiGr merged 1 commit intoTeamNewPipe:release-0-28.1from
TobiGr:enqueue-ui

Conversation

@TobiGr
Copy link
Contributor

@TobiGr TobiGr commented Dec 20, 2025

What is it?

  • Bugfix (user facing)

Description of the changes in your PR

onNext() is called after onSubscribe() when creating a PlayQueueAdapter. 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 to PublishSubject<> which does not emit the last event after onSubscribe().

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 BehaviorSubject was 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

@TobiGr TobiGr added GUI Issue is related to the graphical user interface queue Issue is related to queueing labels Dec 20, 2025
@github-actions github-actions bot added the size/small PRs with less than 50 changed lines label Dec 20, 2025
@TobiGr TobiGr added this to v0.28.x Dec 20, 2025
@github-project-automation github-project-automation bot moved this to Todo in v0.28.x Dec 20, 2025
@TobiGr TobiGr moved this from Todo to In Progress in v0.28.x Dec 20, 2025
@TobiGr TobiGr added the bug Issue is related to a bug label Dec 20, 2025
onNext() is called after onSubscribe() when creating a PlayQueueAdapter. 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 to PublishSubject<> which does not emit the last event after onSubscribe().

Ref: TeamNewPipe#9669
@dustdfg
Copy link
Contributor

dustdfg commented Jan 1, 2026

😍 I've suffered from this bug for so long! I've tested and it seems to work seamlessly

@TobiGr TobiGr changed the base branch from dev to release-0-28.1 January 2, 2026 08:26
@absurdlylongusername
Copy link
Member

I've pulled and tested changes with and without the fix and can confirm it works.

I want to add tests for this. Should I add them on dev or refactor?

@TobiGr
Copy link
Contributor Author

TobiGr commented Jan 7, 2026

I'd add the tests to dev if this part has not been touched on the refactor branch or in any of the currently open refactor PRs.

@TobiGr TobiGr merged commit 680235a into TeamNewPipe:release-0-28.1 Jan 7, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in v0.28.x Jan 7, 2026
@TobiGr TobiGr mentioned this pull request Jan 7, 2026
4 tasks
@TobiGr TobiGr deleted the enqueue-ui branch February 3, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue is related to a bug GUI Issue is related to the graphical user interface queue Issue is related to queueing size/small PRs with less than 50 changed lines

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

"Enqueue Next" item displays on Play queue incorrectly

3 participants