Fix leaderboard tier criteria using stale cached data

ownEntryPeek() was mixing freshUserSkills() for tier assignment
with userSkills() (cached) for tier intervals, causing displayed
tier criteria to be out of sync with actual tier assignments.

Minor perf trade-off: freshUserSkills() is now called twice in
ownEntryPeek(), but this only affects users checking their position
beyond the main leaderboard size.

Fixes #2588
This commit is contained in:
Kalle 2026-01-03 16:45:17 +02:00
parent da603f4d7c
commit dd9e74d1b6

View File

@ -1,7 +1,7 @@
import { cachified } from "@epic-web/cachified";
import * as Seasons from "~/features/mmr/core/Seasons";
import { USER_LEADERBOARD_MIN_ENTRIES_FOR_LEVIATHAN } from "~/features/mmr/mmr-constants";
import { freshUserSkills, userSkills } from "~/features/mmr/tiered.server";
import { freshUserSkills } from "~/features/mmr/tiered.server";
import * as UserRepository from "~/features/user-page/UserRepository.server";
import type { MainWeaponId } from "~/modules/in-game-lists/types";
import { weaponCategories } from "~/modules/in-game-lists/weapon-ids";
@ -157,7 +157,7 @@ export function ownEntryPeek({
const withTier = addTiers([found], season)[0];
const { intervals } = userSkills(season);
const { intervals } = freshUserSkills(season);
const currentTierIndex = intervals.findIndex(
(interval) =>