Files
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7andWill Pfleger 34a8ecbf6f fix: prevent timeline cap from evicting backward-paged roots on live event
Two CI failures on main:

1. File-size guard: lib.rs grew by one line in PR #1246
   (show_native_notification added to Tauri command list). Bump the
   approved override from 1034 to 1035 and update the comment.

2. Scroll-history regression (scroll-history.spec.ts:1363): when the
   user scrolls back past MAX_TIMELINE_MESSAGES (2000) events, a live
   subscription event arriving via mergeTimelineCacheMessages triggered
   normalizeTimelineMessages, which caps to the newest 2000. This evicted
   the backward-paged roots, reset oldestAfterMerge, and stalled
   pagination — deepest stalled at ~471 instead of reaching < 50.

   Fix: mergeTimelineCacheMessages now checks the content-event count on
   the ORIGINAL current array (before dedup+incoming). If the cache is
   already in backward-paged state (> MAX_TIMELINE_MESSAGES content
   events), it skips the cap and returns sort+dedupe only. The cap still
   applies during normal live sessions (cache at or under the limit).

   Also exports isTimelineWindowContentEvent and MAX_TIMELINE_MESSAGES
   from messageQueryKeys.ts so hooks.ts can reference them directly.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-26 15:28:19 -04:00
..