Skip to content

fix(details): show the watchlist bookmark at once instead of after Trakt and cloud sync - #755

Merged
ProdigyV21 merged 3 commits into
ProdigyV21:mainfrom
ReichiMD:claude/vigilant-albattani-n5la5k
Sep 25, 2026
Merged

ProdigyV21 merged 3 commits into
ProdigyV21:mainfrom
ReichiMD:claude/vigilant-albattani-n5la5k

Conversation

@ReichiMD

Copy link
Copy Markdown
Contributor

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 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 then uploads the account state.

Changes

  • Details page (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).
  • Double tap: writes run one at a time under a mutex and save whatever the bookmark shows at that moment, so they cannot finish out of order. Two taps that cancel each other out write nothing.
  • Initial load: the page load's watchlist read no longer overwrites a tap made while it was still running.
  • Home long-press menu (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

  • New 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 current main.
  • Full testSideloadDebugUnitTest: 1728 tests green.
  • Phone (sideload debug build, ARVIO account + Trakt connected): the bookmark ticks and unticks instantly for a movie and a series (before: 4-5 s in both directions). A quick double tap ends in the state shown, also after leaving and reopening the page, and the title appears in the Trakt watchlist.

created by Claude (Anthropic) on behalf of @ReichiMD

…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
@github-actions github-actions Bot added the area: android Changes to the Android app or Gradle build label Sep 25, 2026
@ProdigyV21
ProdigyV21 merged commit d8b7ccc into ProdigyV21:main Sep 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: android Changes to the Android app or Gradle build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants