Repository navigation
Description
Raised by Copilot's review of #224 (#103, the Up Next sheet), which widens a gap that was already there.
Problem
The Library tabs skip reloading for five minutes after a successful load:
// src/AniSprinkles.Core/PageModels/MediaListPageModel.cs
private static readonly TimeSpan ListRefreshInterval = TimeSpan.FromMinutes(5);
...
var isFresh = _lastSuccessfulLoadUtc != default &&
DateTimeOffset.UtcNow - _lastSuccessfulLoadUtc < ListRefreshInterval;Only a change made from the Library forces a reload: its EntryActionCoordinator host passes OnEntryStatusChangedAsync = _ => LoadAsync(forceReload: true) (MediaListPageModel.cs:217). Every other surface that saves a list entry updates only its own cards:
- Discover, Browse and Search hosts:
OnEntryStatusChangedAsync = entry => { ApplyEntryToItems(entry); ... }(DiscoverPageModel.cs:93,MediaBrowsePageModel.cs:91,SearchPageModel.cs:97). - The media details page saves through
AniList.SaveMediaListEntryAsyncdirectly and tells no one. - The Up Next sheet (Offer to add the next season/related entries when you complete a series #103) moves other titles (Paused → Watching, Completed → Rewatching, …) from any of those surfaces.
So after a status change made anywhere but the Library, the Library can show the title in its old section for up to five minutes. That is worse than cosmetic: long-pressing the stale card and editing it (progress, rating) saves the whole entry, old status included, and undoes the change.
Impact
- Display: a title shows in the wrong section until the window lapses or the user pulls to refresh.
- Data: an edit made from the stale card writes the old status back to AniList.
Options
Not settled; for kickoff.
A. A shared "list changed" signal. A small singleton that every successful list save notifies (coordinator hosts, the details page, Up Next); the Library treats a notification as "stale" and reloads on its next appearance. One place to call, testable in Core. Needs every save path to remember to call it.
B. Hook it below the page models. CachingAniListClient already sees every SaveMediaListEntryAsync / DeleteMediaListEntryAsync; it could raise the signal itself, so no call site can forget. Couples the cache decorator to page-level freshness.
C. Patch the Library's copy in place from the saved entry instead of reloading. Cheapest in requests, but it re-implements sectioning outside the loader.
Leaning B (or A fed from B), since a forgotten call site is exactly how this gap appeared. A hypothesis, not a decision.
Constraint
- Rate-limit budget: reload on next appearance, never once per save.
- The adult-content reload (Adult-content setting commits 1.5s late and notifies nobody, leaving 18+ results on screen #118) shares this freshness check; a fix must keep that working.
Related
- Offer to add the next season/related entries when you complete a series #103 / Offer related entries when you complete something (#103) #224: Up Next moves other titles, which made this easy to hit.
- Adult-content setting commits 1.5s late and notifies nobody, leaving 18+ results on screen #118: the adult-toggle exception to the same freshness window.
Activity
zhollis21 commentedon Nov 22, 2026
Decided during planning (with #227's last journey, one branch): option B.
CachingAniListClientbumps a newListChangeTrackercounter after every save that succeeds and every removal that reports success. Each Library half records the counter at load, and the freshness window holds only while the counter is unchanged, so the next appearance after an outside change reloads (2 requests: viewer and list), never once per save. The Library's own +1, rating and progress saves absorb their own bump, because their cards already show the change. A counter rather than a flag, so the Anime and Manga lists each notice the same change. C (patching in place) was rejected: a reload already updates the sections in place throughMediaListSectionsMerger.Merge, so the only saving would be requests, at the cost of a second copy of replay's sectioning logic.Reload the Library after list changes made elsewhere (#225, #227) (#233)