Skip to content

perf(api): batch leaderboard stat lookups#846

Open
ugcodrr wants to merge 29 commits into
mainfrom
perf/batch-leaderboard-stats
Open

perf(api): batch leaderboard stat lookups#846
ugcodrr wants to merge 29 commits into
mainfrom
perf/batch-leaderboard-stats

Conversation

@ugcodrr

@ugcodrr ugcodrr commented May 12, 2026

Copy link
Copy Markdown
Member
  • replace per-row player & guild leaderboard stat lookups with a single Mongo query using uuid: { $in: ids }& id: { $in: ids }

  • getAdditionalStats now returns null for entries whose player or guild document is missing from MongoDB, instead of { name: "Unknown" }; base LeaderboardService filters these out before building the response, so stale Redis entries no longer surface as "Unknown" rows on leaderboard pages.

  • Fix handleGuildNotFound in GuildService to remove the guild from Redis leaderboards when it is deleted from MongoDB.

@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
statsify Ignored Ignored Preview Jun 16, 2026 10:49am

@github-actions github-actions Bot added the api label May 12, 2026
…tries

* deduplicate ids before querying the database
* return a default entry for unknown players and guilds

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

...(extraDisplay ? [extraDisplay] : []),
]
);
const additionalStats = leaderboard.length ?

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.

Since the getAdditionalStats function now can return invalid data, with Unknown as the name, we should probably instead just handle the case if a player or guild is missing rather than just returning garbage data.

jacobk999 and others added 16 commits June 16, 2026 04:49
* chore: update turborepo and typescript + remove commitlint

* chore: update napi-rs/cli and @types/node and unplugin

* chore: add oxlint for packages using basic rules

* chore: add all oxlint rules

* chore: lint api

* chore: lint scripts

* chore: lint site

* chore: lint support-bot and site

* chore: lint rendering package

* chore: lint discord-bot

* chore: update submodules

* fix: types

* chore: remove eslint dependencies and update ci workflow

* chore: update node version in ci

* chore: add lint ci script

* chore: use lint ci script in ci

* chore: rename test:types to typecheck

* chore: use typescript native preview

* chore: update to vitest v4

* chore: update swc version

* chore: update lockfile

* chore: update tailwind

* chore: add compose.dev.yml

* chore: only test affected packages in ci

* chore: remove affected from test script

* chore: add check if rank exists for formatting display names

* chore: remove commented site rules

* chore: format tsconfigs
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jacob Koshy <42344274+jacobk999@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jacob Koshy <42344274+jacobk999@users.noreply.github.com>
* chore(lint): enable stricter no unused variable rules

* chore: update ci

* chore: update ci

* chore: update ci

* chore: remove explicit cache dir for turborepo in package json
* fix: use file urls for dynamic imports

* chore: update ci tests
* chore(config): migrate config renovate.json

* chore: let all dependencies be updatable

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jacobk999 <jababakoshy@gmail.com>
* chore: add .DS_Store to gitignore

* chore: ci run build on all packages

* chore: ci run build on all packages

---------

Co-authored-by: jacobk999 <jababakoshy@gmail.com>
Co-authored-by: jacobk999 <jababakoshy@gmail.com>
Co-authored-by: jacobk999 <jababakoshy@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jacobk999 <jababakoshy@gmail.com>
prefix: "prestige_bracket",
});

this.levelFormatted = scheme({
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants