Repository navigation
Fix past competition sorting with missing end dates - #163
Merged
Merged
Conversation
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
Fixes the remaining “Past competitions / Newest first” issue on
topcoder-dev.com/opportunitiesafter 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
pnpm lintandpnpm buildpassed 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 --checkpassed.This API change must be merged and deployed to dev before the reported site behavior is resolved.