Sort ListWorkers by (TaskQueue, StartTime, WorkerInstanceKey)#10543
Draft
rkannan82 wants to merge 3 commits into
Draft
Sort ListWorkers by (TaskQueue, StartTime, WorkerInstanceKey)#10543rkannan82 wants to merge 3 commits into
rkannan82 wants to merge 3 commits into
Conversation
Replaces the previous WorkerInstanceKey-only sort with a composite key that groups workers by task queue and orders by start time (oldest first) within each group. This provides stable ordering across page refreshes since both TaskQueue and StartTime are immutable for a worker's lifetime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Stale tokens from the old sort order will have zero-value fields, causing the cursor to land at position 0 — the client gets page 1 again. This is acceptable during the narrow rolling-deploy window. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
What
Change ListWorkers pagination sort order from WorkerInstanceKey-only to a composite key: (TaskQueue asc, StartTime asc, WorkerInstanceKey asc).
Why
WorkerInstanceKey is an opaque UUID — sorting by it produces a random-looking order that isn't meaningful to users and shuffles when workers restart. The new sort groups workers by task queue, orders by start time (oldest first) within each group, and uses WorkerInstanceKey as a unique tiebreaker. Both TaskQueue and StartTime are immutable for a worker's lifetime, so the ordering is stable across page refreshes.
How did you test it?
🤖 Generated with Claude Code