feat: connect tournament views to APIs and recover archived stats

Remove development previews and complete hall of fame, match history, official results, and multi-kill API integration.

Fix active match pagination and team-ready controls, preserve basic scoreboards, and recover statistics when Riot archives arrive.

Use bounded in-process cache invalidation retries and add the Riot match lookup index migration with regression coverage.
This commit is contained in:
dahyeon committed 2026-11-11 02:00:35 +09:00
1 parent 20e1e6ec04
commit 0d7617e2d2
70 files changed
+3739 -1793

No files matched your search

@@ -0,0 +1,40 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import type { CompetitionGameView } from '@lolympus/contracts';
import { riotMatchIdForDisplay } from '../src/lib/internal-game-evidence.ts';
test('keeps a real Riot ID visible even when analysis is missing', () => {
const game = {
gameId: 'game-1',
riotMatchId: 'KR_123',
analysisAvailability: 'missing',
};
const official = {
evidence: { type: 'riot', riotMatchId: 'KR_123' },
} as CompetitionGameView;
assert.equal(riotMatchIdForDisplay(game, official), 'KR_123');
});
test('does not label a legacy evidence reference as a Riot ID', () => {
const official = {
evidence: { type: 'legacy', legacyReference: 'KR_123' },
} as CompetitionGameView;
assert.equal(
riotMatchIdForDisplay({ riotMatchId: 'KR_123' }, official),
null,
);
assert.equal(
riotMatchIdForDisplay({ riotMatchId: 'match:legacy:123' }),
null,
);
assert.equal(riotMatchIdForDisplay({ riotMatchId: 'KR_TEMP_123' }), null);
});
test('shows a real Riot ID on unmigrated records and hides unresolved official references', () => {
assert.equal(riotMatchIdForDisplay({ riotMatchId: 'KR_123' }), 'KR_123');
assert.equal(riotMatchIdForDisplay({ riotMatchId: 'NA1_123' }), 'NA1_123');
assert.equal(
riotMatchIdForDisplay({ riotMatchId: 'KR_123', gameId: 'unresolved' }),
null,
);
});