Fix manga details for non-library manga taking longer to load#3055
Open
FlaminSarge wants to merge 3 commits intomihonapp:mainfrom
Open
Fix manga details for non-library manga taking longer to load#3055FlaminSarge wants to merge 3 commits intomihonapp:mainfrom
FlaminSarge wants to merge 3 commits intomihonapp:mainfrom
Conversation
Contributor
Author
|
Note that this should still probably go in despite #2982 being a good rework of the root cause, since currently any time a non-favorite is opened it triggers a |
AntsyLich
requested changes
Mar 19, 2026
domain/src/main/java/tachiyomi/domain/manga/interactor/SetMangaChapterFlags.kt
Show resolved
Hide resolved
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.
Fixes #3027
Regression from #2955 (probably)
Moves setDefaultChapterFlags after the initial load so at least the Manga details page shows up while fetches are still happening. Also avoids setting default chapter flags if default is the same as the manga's current flags (for no defaults set or if this is reopening a non-favorite).
The problem seemed to be that the
mangasDB write from setMangaDefaultChapterFlags had to wait for a long time (150+ms on my emulator with a 6000+ library). Not sure if that's due to the mutex changes for DB transactions or something else, but on top of that it also increased the time that availableScanlators and excludedScanlators took; also unsure why that is.Before these changes, timing was something like this:
After the changes:
And if setting the default flags gets to no-op because the default chapter flags are 0 or the same as before, that takes barely any time as well.
availableScanlators/excludedScanlators await's don't have to be moved out of the state update block, but I figured it doesn't hurt and can prevent pain later if those also need to be debugged again (moved them around to get timings for those initially, left them there afterwards).