fix(activity): stop ListEvents pagination from silently skipping feed windows#876
Open
iris-intelligence wants to merge 2 commits into
Open
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ListEventsmerges 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
LIMIT, so the next-page token can never jump past unscanned rows.Fixes #863.
🤖 Generated with Claude Code