Repository navigation
fix(#1086): ListSchedules refuses a token it could not have issued - #1228
Merged
Merged
Conversation
EventBridge Scheduler's single pagination site carried the pre-#915 idiom — DecodeString then Atoi with both errors discarded — so a token substrate could not have minted left the offset at zero and the operation answered a well-formed page one. That is the one wrong answer a paginating caller cannot detect. The decode is now decodeOffsetPaginationToken and the cut is pageByOffsetToken, which is what the handler had written out by hand. The refusal is ValidationException/400, published in the operation's own Errors section; the footing for the condition is the request parameter's own sentence, "The token returned by a previous call to retrieve the next set of results.", not an Errors entry. Decoded above the index load per #887, asserted by sealing the store. Ninth of #1086's ten sites and the only one whose token travels in a query string. Batch's shared paginator behind three describes remains.
5 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Sep 20, 2026
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.
The ninth of #1086's ten sites. EventBridge Scheduler's
ListSchedulescarried the pre-#915 idiom —base64.StdEncoding.DecodeStringthenstrconv.Atoi, both errors discarded — so aNextTokensubstrate could not have minted left the offset at zero and the operation answered a well-formed page one. That is the one wrong answer a paginating caller cannot detect: a loop running until the token comes back empty is handed the first page again, so it spins or reprocesses the same schedules, and nothing in the response says so.The decode is now
decodeOffsetPaginationToken, which defines issuability as a round trip through the encoder, and the cut ispageByOffsetToken, which is what the handler had written out by hand.The code, and where the condition comes from
ValidationException/ 400, published in this operation's own Errors section and glossed "The input fails to satisfy the constraints specified by an AWS service." — the page's own vocabulary, not a sibling's, which is what #671's scope decision requires. It is also already this plugin's only refusal for an input that fails a constraint, so the message carries which input failed, in the1 validation error detected: …shape every other Scheduler refusal renders, with the member spellednextTokenas AWS's own validation messages spell members:The footing for the condition is the request parameter's own sentence, not the Errors section.
API_ListSchedulesdescribesNextTokenas "The token returned by a previous call to retrieve the next set of results." — the page states where a token comes from, so a token no previous call returned is not the thing the parameter is documented to accept. What remains substrate's reading is only that this input problem is the one that gloss covers: the page publishes no code AWS attributes to a pagination token. The published Length of 1–2048 is subsumed by the round trip, and its minimum of 1 is why an emptyNextTokenis an absent token rather than an invalid one.The token is decoded above the name-index load, which is #887's criterion. There is no required member on this operation and no schedule to resolve, so unlike the three Scheduler operations that check
Namefirst, nothing competes for precedence. Asserted by sealing the state store against reads: Scheduler's index loader propagates a store failure, so the seal can tell the two orderings apart (Athena needed a counting state for the opposite reason).This is the only one of the ten sites whose token travels in a query string, so the round-trip half of the test also proves the encoding survives URL encoding — the fixture sends the token through
url.Values.Encode, because a raw+in a query string decodes to a space and the test would otherwise be asserting about a string the caller never sent. Fixtures are built through realPOST /schedules/<name>calls per #765.What this does not claim, and what it does not fix
ScheduleGroup,NamePrefixorStatedecodes cleanly against another and indexes into a listing the caller never asked for. Every offset paginator in the tree has that property; recorded because the refusal's name invites the stronger reading.decodeOffsetPaginationTokenaccepts it and onlypageByOffsetTokendecides what it means.Statefilter is applied after the page is cut, so a state-filtered request can be answered a page shorter thanMaxResultswhile still carrying aNextToken, where AWS publishesStateas a filter on the listing. Left as it was and to be filed separately: fixing it changes which schedules a page contains rather than which tokens are accepted.MaxResultsabove the published maximum of 100 is clamped, not refused, and zero or below is silently ignored in favor of substrate's own default of 20 (recorded under EventBridge SchedulerListSchedulesreads all five query parameters under names the page does not publish #1226). Refusing an out-of-range page size is its own class.Boundary
Batch's one shared paginator behind
DescribeComputeEnvironments,DescribeJobQueuesandDescribeJobDefinitionsremains, so this does not resolve #1086. The docs table of remaining sites is narrowed to Batch alone, and the stale claim in the Scheduler row it replaced — that "the only constraint published on the token is Length 1–2048" — is corrected: the page does publish where a token comes from, and that sentence is the footing this refusal stands on.Verification
Full nine-step gate green locally, including
make test, the Go 1.26.6 run,make coverage(86.1% emulator / 85.6% total, above the 85.5/85.0 floor), the docs targets and the Docusaurus build.