mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 09:21:39 -05:00
Say you have a dashboard with some jobs you sent. Normally looks like: job | sent --- | --- file.csv | **5pm** file.csv | 3pm file.csv | 1pm file.csv | 11am However if your 5pm job was scheduled at lunchtime, then it will look like this: job | sent --- | --- file.csv | 3pm file.csv | 1pm file.csv | **5pm** file.csv | 11am This is because the jobs are sorted by when they were created, not when they were sent. It looks wrong. **For jobs that have already been sent** This commit changes the sort order to be based on `processed_at` instead. **For upcoming jobs** If a job doesn’t have a `processed_at` time then it’s scheduled, but hasn’t started yet. Only in this case should we still be sorting by `created_at`.