Skip to content

Fix: infinite scroll freeze — revert filteredIllusts cache

jedmund requested to merge jedmund/fix-infinite-scroll into main

Created by: jedmund

Summary

Hotfix for two regressions that followed #32 landing:

  1. First regression (already in this PR's earlier commit, now moot): illustsVersion was @ObservationIgnored, so the cache-hit path of filteredIllusts registered no observation, and paginated appends didn't invalidate the body — infinite scroll silently stopped at the first page boundary.
  2. Second regression (found after the above fix): once pagination was unstuck, the UI froze under scroll after the third page boundary. The cache + observation-tracked counters + SwiftUI body re-render chain interacted in a way I couldn't nail down from code review alone.

Simplest correct fix: drop the cache entirely. The user confirmed scroll was smooth before the cache landed, and the O(n) filter the cache was protecting isn't actually expensive at realistic feed sizes (120+ illusts). filteredIllusts(behavior:mutes:) is back to a plain pure filter.

Removed from IllustFeedViewModel:

  • illustsVersion + all bump sites.
  • filterCache, FilterCache, FilterCacheToken.

Removed from MutesStore:

  • version + all bump sites.

Test plan

  • Open Home, scroll past the first page — new cells mount, pagination continues through 2, 3, 4, … pages without freezing.
  • Same on a tag feed.
  • Same on a user profile's works grid.
  • Mute/unmute from a profile — feed filters immediately.
  • Pull-to-refresh drops back to the first page and re-paginates.

🤖 Generated with Claude Code

Merge request reports

Loading