Skip to content

fix: deadline-asc sort no longer ranks expired bounties as soonest - #733

Open
smartcalsystems-sketch wants to merge 1 commit into
MergeFi:mainfrom
smartcalsystems-sketch:fix-deadline-sort-past-expired-703
Open

smartcalsystems-sketch wants to merge 1 commit into
MergeFi:mainfrom
smartcalsystems-sketch:fix-deadline-sort-past-expired-703

Conversation

@smartcalsystems-sketch

Copy link
Copy Markdown

Problem

deadline-asc sorted by raw timestamp, so an already-expired deadline (the smallest timestamp) ranked first. A contributor choosing "Deadline: soonest" would see bounties they can no longer complete ahead of urgent-but-still-open ones.

Fix

Captures now once per sort call, classifies each deadline as expired or not, and ranks every non-expired deadline before every expired one. Within each group, ordering is still ascending by timestamp (soonest-upcoming first among open bounties; longest-expired first among expired ones). Bounties with no deadline are unaffected and still sort last, as before.

Testing

  • Added a test with a mix of near/far-future, recently/long-expired, and no-deadline bounties, asserting open ones rank before expired ones regardless of raw timestamp magnitude.
  • Full bounty-query.test.ts suite: 23/23 passing (22 pre-existing + 1 new), zero regressions.
  • tsc --noEmit and eslint clean on both changed files.

Closes #703

@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown

@smartcalsystems-sketch is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

'Deadline: soonest' sort lists bounties whose deadline already passed first

1 participant