Skip to content

fix(activity): stop ListEvents pagination from silently skipping feed windows#876

Open
iris-intelligence wants to merge 2 commits into
seed-hypermedia:mainfrom
iris-intelligence:fix/activity-feed-pagination-skip
Open

fix(activity): stop ListEvents pagination from silently skipping feed windows#876
iris-intelligence wants to merge 2 commits into
seed-hypermedia:mainfrom
iris-intelligence:fix/activity-feed-pagination-skip

Conversation

@iris-intelligence

Copy link
Copy Markdown
Contributor

Summary

ListEvents merges two independently-limited queries (structural blobs + mentions) and pages on the minimum cursor of the returned page. When a page loses events to the deleted/dedup filter, an old mention can slip into the page and its ancient cursor poisons the next-page token, skipping every event between the main scan's floor and that mention. On the seedteamtalks site this swallowed a multi-hour window of comments.

Changes

  • Clamp the merged page to the deepest scan floor among the fetches that filled their LIMIT, so the next-page token can never jump past unscanned rows.
  • Emit a next-page token when a page comes back empty after filtering, instead of ending pagination early.
  • Emit a token when truncation cuts the merged list even though both fetches were under-full.
  • Add regression tests covering the skipped-window, empty-after-filter, and truncation cases.

Fixes #863.

🤖 Generated with Claude Code

iris-intelligence and others added 2 commits July 14, 2026 11:00
… windows

ListEvents merges two independently-limited queries (structural blobs +
mentions) and pages on the minimum cursor of the returned page. When the
page loses events to the deleted/dedup filter, an old mention slips into
the page and its ancient cursor poisons the next-page token, skipping
every event between the main scan's floor and that mention — on the
seedteamtalks site this swallowed a multi-hour window of comments.

Clamp the merged page to the deepest scan floor among the fetches that
filled their LIMIT, so the token can never jump past unscanned rows.
Also emit a token when a page comes back empty after filtering, and when
truncation cuts the merged list even though both fetches were under-full.

Fixes seed-hypermedia#863.

Co-Authored-By: Claude Fable 5 <[email protected]>
Two regression tests for the ListEvents pagination fix:

- TestListEventsObservedOrderDoesNotSkipWindowWhenOldMentionEntersPage:
  observed-time counterpart of the existing claimed-time skip-window
  test. In observed order the cursor is the blob id and sortFeedEvents
  takes a different branch, so the coverage clamp must be exercised here
  too. Fails on the unfixed code with "does not contain 2".

- TestListEventsEmitsNextTokenWhenClampEmptiesPage: pins the empty-page
  dead-end fix. When the deleted/dedup filter and the coverage clamp
  together empty a page while the main fetch was full, a next-page token
  must still be emitted so the clamped rows stay reachable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New comments are not showing up in the Activity Feed

2 participants