Files
Gabriel Vidal 6ecd51f9fe fix(conversations): running conversations vanishing from the list
The shared infinite conversation query retains 12 pages (maxPages), and
TanStack evicts from the *front* — so once a 13th page is fetched, page 1
goes: the newest 50 conversations, which is exactly where every running one
lives. They disappeared from the home Running rail, the History navigator and
the cards page, while the backend reported them correctly all along.

What kept fetching that far: both lists call fetchNextPage() from the
virtualized list's onEndReached, unguarded. An interval-filtered or searched
list is short by construction, so its end sits permanently in view — each
render paged one step further back until the retention window had slid off the
newest conversations entirely. It only became reachable when the archive grew
past 12x50 = 600 conversations (637 today), which happened to coincide with a
Claude Code update.

- useConversations stops advertising hasNextPage at MAX_PAGES, so the window
  is anchored on the newest page and eviction can never happen; MAX_PAGES 12
  -> 24 (1200) so the cap isn't reached in practice.
- onEndReached no longer fires while a fetch is in flight, nor while an
  interval/search filter is narrowing the list (the existing
  searching/needOlder effect pulls exactly the pages those need, and stops).
  A project-tag filter still pages on scroll.

A plain page load now costs 1 list request instead of 25+.
2026-08-15 01:22:03 +02:00
..