Skip to content

Fix past competition sorting with missing end dates - #163

Merged
jmgasper merged 1 commit into
developfrom
sorting_fix
Oct 1, 2026
Merged

jmgasper merged 1 commit into
developfrom
sorting_fix

Conversation

@jmgasper

@jmgasper jmgasper commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the remaining “Past competitions / Newest first” issue on topcoder-dev.com/opportunities after platform-ui #2421.

The deployed UI correctly requests sortBy=endDate&sortOrder=desc, but PostgreSQL puts null end dates first for a descending sort. The dev API's first ten results were all undated challenges, including “DS MM Dec 8” and “AI Screener t1.” The member-filtered in-memory comparator also inverted its missing-date handling for descending order.

End-date sorting now explicitly places missing dates last in both directions, with ascending challenge ID as a tie-breaker before pagination. Public and member-filtered searches use the same ordering. Undated records remain in the results and total count. No schema migration or additional UI change is required.

Validation

  • Confirmed the deployed Opportunities JavaScript includes the merged end-date sorting change.
  • Reproduced the null-first results directly against the dev Challenge API.
  • PostgreSQL-backed regression passed for public/member searches, ascending/descending dates, equal dates, missing dates, and three two-item pages; the existing status-ordering regression also passed (2 tests).
  • pnpm lint and pnpm build passed using Node 26.5.1. Local commands disabled pnpm's dependency auto-install check to reuse the existing matching dependencies in the isolated worktree.
  • git diff --check passed.

This API change must be merged and deployed to dev before the reported site behavior is resolved.

@jmgasper
jmgasper merged commit e228598 into develop Oct 1, 2026
5 checks passed
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.

1 participant