Skip to content

Cut pagination off on createdAt, the field the ordering guarantees - #671

Open
Thayorns wants to merge 3 commits into
zerocracy:masterfrom
Thayorns:661-fix-pagination-cutoff
Open

Cut pagination off on createdAt, the field the ordering guarantees#671
Thayorns wants to merge 3 commits into
zerocracy:masterfrom
Thayorns:661-fix-pagination-cutoff

Conversation

@Thayorns

@Thayorns Thayorns commented Sep 2, 2026

Copy link
Copy Markdown

total_releases_published asks for releases ordered by CREATED_AT DESC but decides when to stop paginating by looking at publishedAt. Those two fields part company on any release that was drafted long ago and published later: its publishedAt sits inside the window while its createdAt is old, or the other way round. When a whole page reads as published before since, 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 alongside publishedAt. Counting still uses publishedAt, 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 since on the boundary and checks the scan keeps going.

Closes #661

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
@Thayorns

Thayorns commented Sep 2, 2026

Copy link
Copy Markdown
Author

@yegor256 fixed here, take a look please

yegor256 commented Sep 3, 2026

Copy link
Copy Markdown
Member

This touches the same total_releases_published boundary condition as #678, via a different approach — only one should be merged. Assigning to @yegor256 to reconcile.


Generated by Claude Code

@Thayorns Thayorns changed the title fix(#661): stop pagination cutoff on createdAt, not publishedAt Cut pagination off on createdAt, the field the ordering guarantees Sep 3, 2026
@Thayorns

Thayorns commented Sep 3, 2026

Copy link
Copy Markdown
Author

@yegor256 take a look please

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.

total_releases_published stops paginating on the wrong field in lib/fbe/github_graph.rb

2 participants