Repository navigation
fix(api): skip the first v8 format's revisions/<sha>.json in CMS Releases - #8425
Merged
Merged
Conversation
…ases Sites published under the first v8 format (#8062) still keep flat `revisions/<commit-sha>.json` files next to the new revision folders. S3/R2 MaxKeys counts those files together with the CommonPrefixes, and the plain hex SHAs sort before the inverted-timestamp ids, so the Releases tab returned empty pages until "Load more" got past them (osklenbr-faststore-studio: 2 empty pages before the 19 releases). The first page now LISTs with StartAfter = the revision-id floor of a day from now. Every id minted so far sorts above it, and almost every SHA sorts below it, so the old files are never paged through. Co-Authored-By: Claude Opus 5.5 <[email protected]>
tlgimenes
enabled auto-merge (squash)
November 10, 2026 15:30
decocms Bot
pushed a commit
that referenced
this pull request
Nov 10, 2026
PR: #8425 fix(api): skip the first v8 format's revisions/<sha>.json in CMS Releases Bump type: patch - decocms (apps/api/package.json): 4.562.1 -> 4.562.2 Deploy-Scope: server
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.
Problem
On sites migrated to v8 before #8379, the Releases tab opens empty, and the releases only show up after clicking Load more a few times.
revisions/still holds the first v8 format's flat<commit-sha>.jsonfiles (#8062) next to the new<inv-ts>-<uuidv7>/folders.listCmsReleasesdoes a delimiter LIST withMaxKeys: 50and keeps onlyCommonPrefixes. But S3/R2 counts plain objects againstMaxKeystoo. Plain hex SHAs (0…–e…) sort before the new ids (fe5e…today), so the first pages were all old files and came back with 0 rows and a cursor. On an affected site, pages 0 and 1 had 0 rows and page 2 had all 19 releases.Fix
The first page uses
StartAfter: revisions/<revisionIdFloor(now + 1 day)>. Because the id prefix is2^48 − 1 − ms, every revision minted so far sorts above that floor. The 1-day margin covers clock skew between Studio instances. Almost every SHA sorts below the floor, so the old files are never listed. A SHA that starts above it (about 1 in 150, e.g.ff…) still takes one slot on a page but never fills a page. Later pages use the continuation token as before; S3 ignoresStartAfterwhen a token is sent, and the store sends only one of them.DeliveryStore.listPagegets an optionalstartAfter, which the S3 store sends asStartAfter.revisionIdFloor(nowMs)lives inrevision-id.ts, next tonewRevisionId.maxKeys, and it honoursstartAfter. Before, it couldn't reproduce this bug.The old files aren't deleted. That would be a separate, destructive cleanup.
Tests
<sha>.jsonfiles (including anff…one) plus 3 revisions → the first page lists all 3 and has no next cursor. This test fails without the fix.start-afteris sent on the first page; on later pages onlycontinuation-tokenis sent.bun test apps/api/src/hosted: 173 pass.tsc --noEmit, biome and oxlint are clean.🤖 Generated with Claude Code
Summary by cubic
Fixes the CMS Releases tab opening empty on sites that still carry flat
revisions/<commit-sha>.jsonfiles from the first v8 format. S3 counts those plain files againstMaxKeys, and they sort below the new revision ids, so the first pages returned 0 rows until "Load more" skipped past them.The first page now lists from a
StartAfterfloor that every current revision id sorts above. The 24h margin absorbs clock skew between Studio instances; the old files aren't deleted.Details
DeliveryStore.listPageaccepts an optionalstartAfter; the memory test store now mirrors S3's sharedMaxKeysand honors it.Written for commit 7af82d8. Summary will update on new commits.