perf(api): batch leaderboard stat lookups#846
Open
ugcodrr wants to merge 29 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
…tries * deduplicate ids before querying the database * return a default entry for unknown players and guilds
jacobk999
reviewed
Jun 6, 2026
| ...(extraDisplay ? [extraDisplay] : []), | ||
| ] | ||
| ); | ||
| const additionalStats = leaderboard.length ? |
Member
There was a problem hiding this comment.
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.
805b63d to
ba946d1
Compare
* 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>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jacobk999 <jababakoshy@gmail.com>
Co-authored-by: jacobk999 <jababakoshy@gmail.com>
* Change return type of getAdditionalStats to allow null values * Update logic to return null for unknown entries instead of default object * Enhance leaderboard data mapping for better clarity
| prefix: "prestige_bracket", | ||
| }); | ||
|
|
||
| this.levelFormatted = scheme({ |
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.
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.