Enable numeric pagination tokens #20299
Merged
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.
For #19339 we will be creating a state index that sorts jobs by
ModifyIndex
, in order to show most-recently-changed jobs at the top of the Nomad web UI, while continuing to sort appropriately with pagination.The current pagination logic assumes all
NextToken
s arestring
s, which results in odd paging behavior (including infinite loops!) when the token is actually a number, due to lexicographical ordering, e.g."10" < "2"
This doesn't go as far as fully generalizing the
Paginator
/Tokenizer
relationship (as might be done withcomparable
orcmp.Ordered
generics), but it adds support foruint64
tokens for my immediate use case, and opens a door for further future flexibility.