Skip to content

fix(leaderboards): trim each leaderboard to its declared limit - #1003

Open
ugcodrr wants to merge 7 commits into
mainfrom
fix/redis-limiter
Open

ugcodrr wants to merge 7 commits into
mainfrom
fix/redis-limiter

Conversation

@ugcodrr

@ugcodrr ugcodrr commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Description: The leaderboard limiter's historical pass built its keys without the DAILY/WEEKLY/MONTHLY prefix, so every run trimmed each historical field's lifetime leaderboard to a tenth of its limit.

  1. Declared limits for those fields are divided by ten to match what the leaderboards already hold, so nothing grows or shrinks.
  2. Descending leaderboards keep exactly the limit instead of one fewer.
  3. /rankings and the /leaderboard player lookup leave out positions past the limit.
  4. The scripts app drops its unused @statsify/api-client dependency.

Merge order for the perf PRs is in #1002. This one goes last.

Testing: pnpm --filter scripts limit-redis on a local Redis keeps exactly each leaderboard's limit.

The limiter's historical pass built its key without the DAILY/WEEKLY/MONTHLY
prefix, so it trimmed the lifetime leaderboard of every field with historical
stats to a tenth of its limit. Historical leaderboards were removed in #547,
so that was the pass's only effect, and the declared limits overstated those
leaderboards tenfold.

- Drop the historical pass
- Declare the sizes the leaderboards hold: fields with historical stats default
  to a tenth of the default limit, and their explicit limits are divided by ten
- Keep exactly `limit` members on descending leaderboards (one was dropped)
- Leave positions past the limit out of rankings (the check let limit + 1 through)
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
statsify Ignored Ignored Nov 2, 2026 3:36am UTC

@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

Deployment failed for project statsify with the following error:

Resource is limited - try again in 1 day (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/statsify-net?upgradeToPro=build-rate-limit

This branch had an error being deployed

1 failed (outdated) deployment
Preview — 8cd5e0de Deployed Oct 21, 2026 by vercel[bot]
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.

1 participant