Skip to content

fix: resolve linked accounts for all winners in final results (#139) - #140

Merged
anurag629 merged 3 commits into
codercops:developfrom
bhushan4work:139
Nov 4, 2026
Merged

anurag629 merged 3 commits into
codercops:developfrom
bhushan4work:139

Conversation

@bhushan4work

Copy link
Copy Markdown
Collaborator

the final-results cron previously looked up linked discord accounts for only the first 10 leaderboard rows, causing linked winners ranked beyond 10 to be incorrectly called unlinked.

what does this change?

  • resolves linked accounts for all winners and the 10 displayed leaderboard rows in final-results announcements.
  • preserves the existing top-10 lookup behavior for weekly updates.

closes #139

how i tested this

  • npm run typecheck
  • npx vitest run test/messages.test.ts test/index.test.ts (59/59 passed)
  • npm test (332/332 passed)
  • git diff --check
  • added regression tests for linked and unlinked winners beyond rank 10.

ai assistance

none

checklist

  • i was assigned the linked issue
  • npm run typecheck and npm test pass
  • new behavior has a test in test/
  • for a bug fix: the new test fails without my change
  • no tokens or secrets in the diff

…ops#139)

The final-results cron only looked up links for the first 10 leaderboard
rows, but messages.ts checks every winner. Linked winners ranked 11th or
lower were called unlinked and their Discord mentions were omitted.

Resolve linked accounts for all winners plus the displayed rows in the
final-results path. The weekly update keeps its top-10 lookup.
@bhushan4work

bhushan4work commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

@anurag629 the breakinig ci is likely due to the gitHub actions env . take a look at this and lemme know if any further fix is expected

@anurag629 anurag629 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @bhushan4work, the fix in index.ts is right. Two things before I merge:

  1. The red CI wasn't your change. A test in page.test.ts used the real clock and broke once October ended. #141 fixed it on develop, so please merge develop into your branch and CI will run again.
  2. The new tests pass without the fix too. In the index test, u11's PRs are dated 2026-10-02, so it reaches 5 early and ranks around 4th, inside the 10 rows the old code already looked up. The messages test passes on develop because messages.ts didn't change. Please make the linked winner the last one to reach 5 (give it the latest dates) so it really ranks 11th. Then the index test fails on develop and passes here.

@anurag629 anurag629 added the codercops-accepted Merged PR that counts on the monthly leaderboard (oss.codercops.com) label Nov 4, 2026
@anurag629
anurag629 merged commit 933aa68 into codercops:develop Nov 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codercops-accepted Merged PR that counts on the monthly leaderboard (oss.codercops.com)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Final results post falsely reports winners past rank 10 as unlinked when topN exceeds 10

2 participants