From dba6136f5f3c948b4c4862d239ab115b58b5a3ce Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Fri, 21 Aug 2026 08:13:03 +0300 Subject: [PATCH] Don't show rosters as skipped on All rosters tab --- .../LeaderboardRepository.server.test.ts | 18 ++++++++++++++++++ .../LeaderboardRepository.server.ts | 5 ++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/features/leaderboards/LeaderboardRepository.server.test.ts b/app/features/leaderboards/LeaderboardRepository.server.test.ts index 7003c83d2..ea073f5cf 100644 --- a/app/features/leaderboards/LeaderboardRepository.server.test.ts +++ b/app/features/leaderboards/LeaderboardRepository.server.test.ts @@ -277,6 +277,14 @@ describe("LeaderboardRepository.findTeamLeaderboardBySeason", () => { }) ).map((entry) => [entry.identifier, entry.placementRank]); + const allRostersPlacements = async () => + ( + await LeaderboardRepository.findTeamLeaderboardBySeason({ + season: SEASON, + onlyOneEntryPerUser: false, + }) + ).map((entry) => [entry.identifier, entry.placementRank, entry.isSkipped]); + beforeEach(async () => { await users.create(9); await playSeasonInWith(topRoster()); @@ -300,6 +308,16 @@ describe("LeaderboardRepository.findTeamLeaderboardBySeason", () => { ]); }); + test("places a skipped team normally on the all rosters leaderboard", async () => { + await skipTeam(topRoster()); + + expect(await allRostersPlacements()).toEqual([ + [userIdsToIdentifier(topRoster()), 1, false], + [userIdsToIdentifier(sharedPlayersRoster()), 2, false], + [userIdsToIdentifier(beatenRoster()), 3, false], + ]); + }); + test("gives a team its placement back when it is unskipped", async () => { await skipTeam(topRoster()); await LeaderboardRepository.deleteTeamSkip({ diff --git a/app/features/leaderboards/LeaderboardRepository.server.ts b/app/features/leaderboards/LeaderboardRepository.server.ts index e8e2d8fc4..9c09044fc 100644 --- a/app/features/leaderboards/LeaderboardRepository.server.ts +++ b/app/features/leaderboards/LeaderboardRepository.server.ts @@ -121,9 +121,12 @@ export async function findTeamLeaderboardBySeason({ season: number; onlyOneEntryPerUser: boolean; }) { + // skipping is about the season finale qualification which the all rosters leaderboard is not concerned with const entries = addSkipped({ entries: await teamLeaderboardBySeasonQuery(season).execute(), - skippedIdentifiers: await findAllTeamSkipIdentifiersBySeason(season), + skippedIdentifiers: onlyOneEntryPerUser + ? await findAllTeamSkipIdentifiersBySeason(season) + : new Set(), }); const withNonSqPlayersHandled = onlyOneEntryPerUser ? await filterOutNonSqPlayers({ season, entries })