Cut pagination off on createdAt, the field the ordering guarantees - #671
Open
Thayorns wants to merge 3 commits into
Open
Cut pagination off on createdAt, the field the ordering guarantees#671Thayorns wants to merge 3 commits into
Thayorns wants to merge 3 commits into
Conversation
The releases connection is ordered by CREATED_AT descending, so the short-circuit that compared publishedAt against `since` could stop before reaching a release that was drafted long ago but published recently. The cutoff now checks createdAt, the field the ordering actually guarantees, so the count no longer comes back short. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G8zaXRaz6FhRzndTSFLhwG
Author
|
@yegor256 fixed here, take a look please |
This was referenced Sep 3, 2026
Member
|
This touches the same Generated by Claude Code |
yegor256
self-requested a review
September 3, 2026 06:22
Author
|
@yegor256 take a look please |
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.
total_releases_publishedasks for releases ordered byCREATED_AT DESCbut decides when to stop paginating by looking atpublishedAt. Those two fields part company on any release that was drafted long ago and published later: itspublishedAtsits inside the window while itscreatedAtis old, or the other way round. When a whole page reads as published beforesince, the loop stops there and never reaches the pages behind it, undercounting the result.The cutoff now reads
createdAt, the field the ordering actually guarantees, and the query asks for it alongsidepublishedAt. Counting still usespublishedAt, which is the right field for the question being answered; only the decision about when to stop walking moved.Three tests cover it. One puts an old-published, recently-created release on the first page and a countable release on the second, and fails on the old code because pagination stopped early. One walks the opposite shape, a recently-published but old-created page, and checks the scan now stops on it. One puts a release created exactly at
sinceon the boundary and checks the scan keeps going.Closes #661