[Jobs] Default managed-jobs dashboard sort to Job ID#9978
Draft
claude[bot] wants to merge 1 commit into
Draft
Conversation
The managed-jobs dashboard list defaulted its API sort to submitted_at, which can be NULL for some jobs and produces an inconsistent default order. Job ID is always populated, so use it as the default sort key. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMCFx7eBmLpkAnZcL9sLU1
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.
Summary
ManagedJobsTable's default sort is already Job ID descending — #9522 set the table's initialsortConfigto{key: 'id', direction: 'descending'}precisely because sorting bysubmitted_atis unstable: jobs submitted in the same second (or with a NULLsubmitted_at) get a non-deterministic secondary order across DB engines, so paging shows IDs out of order.That left one loose end. The code that converts
sortConfiginto the APIsort_byparameter still fell back to'submitted_at':Since the initial
sortConfig.keyis'id'and the table never clears it, this fallback is effectively unreachable today — so this PR is a consistency cleanup, not a change to the default view. It removes a latent footgun: any future code path that leavessortConfig.keyempty would silently revert the list to the unstablesubmitted_atordering.Change: in
sky/dashboard/src/components/jobs.jsx, thesortByfallback'submitted_at'→'id', so it matches the table's actual default. (The default direction already resolves to descending, so newest still shows first.)Not in scope
This does not change the value shown in the "Submitted" column. Jobs with no
submitted_at(e.g. no-op jobs that never start) still render-; populating that value is a separate change (#9980).Test plan
prettier --checkpasses on the changed filesubmitted_at, the default list orders by Job ID descending and the NULL jobs sit in their correct ID position (not displaced). Confirmed the fallback line is not exercised by the normal UI flow — the table sendssort_by=idby default with or without this change.