Skip to content

Fix playlist not clearing when navigating back (#8888) - #13732

Open
Elitenotavailable wants to merge 1 commit into
TeamNewPipe:devfrom
Elitenotavailable:fix-playlist-rapid-back
Open

Fix playlist not clearing when navigating back (#8888)#13732
Elitenotavailable wants to merge 1 commit into
TeamNewPipe:devfrom
Elitenotavailable:fix-playlist-rapid-back

Conversation

@Elitenotavailable

Copy link
Copy Markdown

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Migrated "Remove watched" and "Remove duplicates" logic from LocalPlaylistFragment to a new LocalPlaylistViewModel (Kotlin).
  • Used viewModelScope to ensure that database mutations survive fragment destruction when a user navigates back quickly after confirmation.
  • Refactored LocalPlaylistFragment to observe the ViewModel's workState for managing the loading spinner and error reporting.
  • This addresses the architectural root cause where RxJava disposables were cleared in onDestroyView, prematurely cancelling pending database writes.

Before/After Screenshots/Screen Record

  • The UI remains identical, but the background operation now successfully completes after navigating away.

Fixes the following issue(s)

Relies on the following changes

  • None

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

@github-actions github-actions Bot added the size/large PRs with less than 750 changed lines label Jul 29, 2026
@sonarqubecloud

Copy link
Copy Markdown

@ShareASmile ShareASmile added bug Issue is related to a bug code quality Improvements to the codebase to improve the code quality database Issue and PRs related to database operations playlist Anything to do with playlists in the app labels Jul 30, 2026
@Elitenotavailable

Copy link
Copy Markdown
Author

I am new so how long does it usually takes to review a pull request ?

@TobiGr

TobiGr commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@Elitenotavailable This depends on how complicated the PR is and if there is enough free time to work on NewPipe. Was this PR submitted as part of a university or high scholl course? There is a similar PR that is migrating the playlist to view model.

@Isira-Seneviratne Can you take a look at your PR and this one? Our plan is to stop working on the refactor branch and merge directly to dev (see #13635). I think that you introduced a separate library for paging.

@Elitenotavailable

Elitenotavailable commented Jul 31, 2026

Copy link
Copy Markdown
Author

@TobiGr Actually Yes , This can be said as a part of university project , I need to contribute to big open source projects like more than a 100 stars to apply for the open source development community of my college next week and I am also Learning :) , this is my first PR

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 code quality Improvements to the codebase to improve the code quality database Issue and PRs related to database operations playlist Anything to do with playlists in the app size/large PRs with less than 750 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playlist not cleared if going back quickly

3 participants