Skip to content

fix: stabilize guild monthly leaderboards#844

Open
ugcodrr wants to merge 2 commits into
mainfrom
fix/guild-monthly-leaderboards
Open

fix: stabilize guild monthly leaderboards#844
ugcodrr wants to merge 2 commits into
mainfrom
fix/guild-monthly-leaderboards

Conversation

@ugcodrr
Copy link
Copy Markdown
Member

@ugcodrr ugcodrr commented May 12, 2026

Summary

  • preserve cached per-day guild GEXP totals when recomputing rolling daily/weekly/monthly values
  • prevent monthly/scaled monthly GEXP from dropping when member history disappears from the current Hypixel guild member list
  • keep guild leaderboard rendering resilient when a stale leaderboard id maps to a missing or partial guild document
  • reuse the shared exp-history merge helper for member history so the cached/current GEXP merge avoids per-day object spreading and extra allocations

Root Cause

Guild monthly GEXP was recomputed only from the current Hypixel member list. If a member left, or if current member history omitted a day that was previously cached, that contribution disappeared from the recomputed 30-day aggregate and Redis leaderboard scores could be updated downward without an actual monthly reset.

The member-level cached/current history merge also rebuilt the accumulator object on every cached day. Reusing the same helper used by the guild-level preserved totals keeps the stabilization behavior intact while reducing temporary allocations during guild refreshes.

Testing

  • pnpm --filter api test:types
  • pnpm vitest --project api

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

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

Project Deployment Actions Updated (UTC)
statsify Ready Ready Preview, Comment May 12, 2026 0:04am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant