mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-09 15:36:45 +02:00
* fix(timeline): exclude activities from comment page budget The /timeline endpoint paginated comments + activities through one shared 50-row budget, so an issue with a chatty agent (status flips, task_completed markers, assignee toggles per run) could trigger "show older" with as few as 10-20 actual comments — users opened the page and thought their discussion had vanished. - Comment limit drops from 50 to 30 (the visible page size users wanted). - has_more_before / has_more_after gate on comments alone via the new hasMoreCommentsBeyond helper. Activity rows still ride along at the same per-call SQL cap but no longer push real comments off-page. - Merge functions stop truncating at the page limit; both pools are individually bounded by SQL, so dropping rows here only re-introduced the bug. The legacy (pre-cursor) path applies its 200-row cap inline. - Test rewrite: TestHasMoreBeyond → TestHasMoreCommentsBeyond, replaced the #2192 merge-truncation regression with a #1857 "dense activity does not hide comments" test that pins the new contract directly. Co-authored-by: multica-agent <github@multica.ai> * fix(timeline): per-pool keyset cursor for comments and activities Pre-fix, next_cursor / prev_cursor anchored on the merged page boundary (oldest / newest entry overall). When activity rows were older than every fetched comment — common on issues created with a status change before the first comment — the latest page emitted a cursor pointing at that activity, and the next "show older" call sent that timestamp into ListCommentsBefore, skipping every unreturned comment in between. GPT-Boy flagged this on PR #2253 with the 80-comment / 30-activity scenario where 50 comments became permanently unreachable. The fix splits the cursor into independent comment and activity positions: - timelineCursor carries (CommentT, CommentID, ActivityT, ActivityID). encode/decode signatures changed accordingly. - New cursorPos type and four bounds helpers (commentBoundsDesc / Asc, activityBoundsDesc / Asc) extract per-pool oldest/newest from fetched rows, with a carry fallback so empty pools advance past the input cursor instead of resetting. - All four mode handlers (latest, before, after, around) now derive cursors from each pool's own bounds. Removed the entryTimestamp / entryID helpers that re-parsed the merged entry slice. Tests: - TestTimelineCursor_RoundTrip pins the encode/decode contract for the new dual-pool format (and rejects garbage input). - TestListTimeline_PerPoolCursorWalksAllComments reproduces GPT-Boy's exact scenario (30 activities older than 80 comments, limit=30) and asserts every comment is reachable through repeated `before=<cursor>` walks. Co-authored-by: multica-agent <github@multica.ai> --------- Co-authored-by: multica-agent <github@multica.ai>