Skip to content

fix: displayed submittedAt diverging its DB sort key - #181

Merged
amandazhuyilan merged 2 commits into
devfrom
fix-other-page-sorting
Sep 23, 2026
Merged

amandazhuyilan merged 2 commits into
devfrom
fix-other-page-sorting

Conversation

@amandazhuyilan

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

Fix job displayed date diverging from its actual sort position

On the Jobs page, a job could appear out of order relative to its neighbors — e.g. a job submitted today showing up mid-list instead of first when sorted by Submitted (desc)

Root cause: _build_job_list_item displayed submittedAt from a live Seqera payload's own "submit" field when one was fetched, but the SQL query sorts by the DB's submission_timestamp column — these can differ for any job that still needs a live Seqera check (i.e. not yet marked finalized in the DB), so the row lands in its correct DB-sorted position but shows a date that contradicts it

Fix

Prefer owned_run.submission_timestamp (the DB column, always set at creation, and what the SQL query actually sorts by) over the live payload's timestamp, falling back to it only if the DB column is somehow unset

Added a regression test: a job with an old DB submission_timestamp but a live payload reporting "today" now displays the old (correctly-sorted) date, not the misleading live one

How to Test

CI tests shall pass

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added or updated documentation where necessary
  • I have run linting and unit tests locally
  • The code follows the project's style guidelines

@vtnphan vtnphan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good fix here

@amandazhuyilan
amandazhuyilan merged commit 58d274a into dev Sep 23, 2026
2 checks passed
@amandazhuyilan
amandazhuyilan deleted the fix-other-page-sorting branch September 23, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants