Fix bug of search history randomly not saved#13061
Closed
Conversation
Don't create disposable from operation of storing search to history because as we certainly want this to complete. Disposable was created in `search` method and then alsmost immediately was called `startLoading` which disposed "all" disposables including our operation of search storing (if was unlucky enough to not finish before this moment)
ghost
commented
Jan 14, 2026
| disposables.add(historyRecordManager.onSearched(serviceId, theSearchString) | ||
|
|
||
| historyRecordManager.onSearched(serviceId, theSearchString) | ||
| .observeOn(AndroidSchedulers.mainThread()) |
Author
There was a problem hiding this comment.
Maybe I should change it to shedulers io?
ghost
commented
Jan 14, 2026
| .subscribe( | ||
| ignored -> { | ||
| }, | ||
| throwable -> showSnackBarError(new ErrorInfo(throwable, UserAction.SEARCHED, |
Author
There was a problem hiding this comment.
I am still not sure it is safe because of call to showSnackBarError. The same thing is with delete history item operations in the file...
Please help to answer following questions:
- Is current approach of this PR safe?
- If not safe maybe I should create separate composite disposable specifically for db these db related tasks?
2.1. ...And then renamedisposablesvariable as would be used for only one purpose a bit above this code (checking if search is url which can be opened in newpipe directly...)
I am almost sure 2 + 2.1 is the best way to go but Idk
This pull request was closed.
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 is it?
Description of the changes in your PR
Fix bug of search history randomly not saved
Don't create disposable from operation of storing search to history because as we certainly want this to complete.
Disposable was created in
searchmethod and then alsmost immediately was calledstartLoadingwhich disposed "all" disposables including our operation of search storing (if was unlucky enough to not finish before this moment)Fixes the following issue(s)
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