fix(details): show the watchlist bookmark at once instead of after Trakt and cloud sync - #755
Merged
ProdigyV21 merged 3 commits intoSep 25, 2026
Conversation
…akt and cloud sync Tapping the bookmark on the details page took 3-5 seconds to tick or untick for users with Trakt and an ARVIO account. toggleWatchlist() only updated isInWatchlist after the Trakt/SIMKL write, the local save and cloudSyncRepository.pushToCloud(), which waits for the cloud-sync lock, downloads the server snapshot and uploads the account state. - Details: flip the bookmark and show the toast right away, then write Trakt/SIMKL and the local watchlist; push to the cloud only after a successful save. If the write fails, the bookmark goes back and the existing error toast shows (before, it silently stayed off). - Writes run one at a time under a mutex and save whatever the bookmark shows at that moment, so a quick double tap cannot finish out of order, and two taps that cancel out write nothing. - The initial details load no longer overwrites a tap made while the watchlist state was still being read. - Home long-press menu: show the confirmation before the cloud push instead of after it. The flow is otherwise unchanged. Tests: DetailsWatchlistToggleTest covers a hanging cloud push, a Trakt failure, a double tap while the first save is running, a double tap after a failed first save, and a tap during the initial load. Four of the five fail on the previous code. Full suite 1728 tests green. created by Claude (Anthropic) on behalf of @ReichiMD Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KoPX7cGg7NLAhgbicWUQ9T
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.
Summary
Tapping the watchlist bookmark on the details page takes 3-5 seconds to tick or untick when Trakt and an ARVIO account are connected (reported by a user on Discord, reproduced on a phone: 4-5 s in both directions).
toggleWatchlist()only updatedisInWatchlistafter the Trakt/SIMKL write, the local save andcloudSyncRepository.pushToCloud(), which waits for the cloud-sync lock, downloads the server snapshot and then uploads the account state.Changes
DetailsViewModel.toggleWatchlist): the bookmark and the toast flip right away; the Trakt/SIMKL write and the local save follow, and the cloud push runs only after a successful save. If the write fails, the bookmark goes back and the existing error toast shows (before, it silently stayed off).HomeViewModel.toggleWatchlist): the confirmation toast now shows before the cloud push instead of after it. The flow is otherwise unchanged.The library's remove already showed its result before
pushToCloud(); this brings the details page in line with it.Testing
DetailsWatchlistToggleTest(5 cases): hanging cloud push, Trakt failure, second tap while the first save is running, second tap after a failed first save, tap during the initial load. Four of the five fail on currentmain.testSideloadDebugUnitTest: 1728 tests green.created by Claude (Anthropic) on behalf of @ReichiMD