Skip to content

Conversation

@jmgasper
Copy link
Collaborator

Winner tab display would sometimes show Checkpoint review scores and submission IDs, which was confusing

@jmgasper jmgasper requested a review from kkartunov as a code owner October 30, 2025 05:50
@jmgasper jmgasper merged commit dbd3a51 into dev Oct 30, 2025
4 of 6 checks passed
// Find all submissions for this member
const memberSubmissions = submissions.filter(s => s.memberId === memberId)
const contestSubmissions = memberSubmissions.filter(
submission => (submission.type ?? SUBMISSION_TYPE_CONTEST) === SUBMISSION_TYPE_CONTEST,

Choose a reason for hiding this comment

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

[⚠️ correctness]
The use of the nullish coalescing operator (??) here assumes that submission.type can be null or undefined. Ensure that this is the intended behavior and that submission.type is not expected to have other falsy values like an empty string.

submission => (submission.type ?? SUBMISSION_TYPE_CONTEST) === SUBMISSION_TYPE_CONTEST,
)

// Prefer contest submissions; fall back to everything so we still display something if data is inconsistent

Choose a reason for hiding this comment

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

[⚠️ design]
The logic here prioritizes contest submissions over others. Ensure that this prioritization aligns with the business requirements and that non-contest submissions should indeed be considered only as a fallback.


// Only expose contest submissions in the winners list
const contestWinners = winners.filter(winner => (
(winner.type ?? SUBMISSION_TYPE_CONTEST) === SUBMISSION_TYPE_CONTEST

Choose a reason for hiding this comment

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

[⚠️ correctness]
The use of the nullish coalescing operator (??) with winner.type assumes that winner.type can be null or undefined. Ensure that this is the intended behavior and that winner.type is not expected to have other falsy values like an empty string, which would bypass the defaulting to SUBMISSION_TYPE_CONTEST.

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