Clean up abandoned matches and fix analytics validation
This commit is contained in:
@@ -9,7 +9,7 @@ import { PRESENCE_AUTH_REFRESH_MS } from '../constants/presence.js';
|
||||
|
||||
test('presence counts authenticated players once across tabs and removes disconnected players', async () => {
|
||||
const http = createServer(), io = new Server(http);
|
||||
registerPresence(io, { async get(auth: { token: string; gameSessionId: string }) {
|
||||
registerPresence(io, { async touchPresence(auth: { token: string; gameSessionId: string }) {
|
||||
if (auth.token !== 'valid') throw new ApiError(401, 'INVALID_SESSION');
|
||||
return { playerId: auth.gameSessionId.startsWith('a') ? 'a' : 'b' };
|
||||
} } as unknown as GameSessionStore);
|
||||
@@ -45,7 +45,7 @@ test('temporary revalidation errors allow reconnect, invalid sessions remain dis
|
||||
}) as typeof setInterval);
|
||||
let failure: 'temporary' | 'invalid' | undefined;
|
||||
const http = createServer(), io = new Server(http);
|
||||
registerPresence(io, { async get() {
|
||||
registerPresence(io, { async touchPresence() {
|
||||
if (failure === 'invalid') throw new ApiError(401, 'INVALID_SESSION');
|
||||
if (failure === 'temporary') { failure = undefined; throw new Error('DB_UNAVAILABLE'); }
|
||||
return { playerId: 'one' };
|
||||
|
||||
Reference in New Issue
Block a user