diff --git a/src/server/Archive.ts b/src/server/Archive.ts index 4361014fe..b540f9c8d 100644 --- a/src/server/Archive.ts +++ b/src/server/Archive.ts @@ -7,6 +7,7 @@ import { ID, PartialGameRecord, } from "../core/Schemas"; +import { replacer } from "../core/Util"; import { logger } from "./Logger"; const config = getServerConfigFromServer(); @@ -25,7 +26,7 @@ export async function archive(gameRecord: GameRecord) { const url = `${config.jwtIssuer()}/game/${gameRecord.info.gameID}`; const response = await fetch(url, { method: "POST", - body: JSON.stringify(gameRecord), + body: JSON.stringify(gameRecord, replacer), headers: { "Content-Type": "application/json", "x-api-key": config.apiKey(), diff --git a/src/server/Worker.ts b/src/server/Worker.ts index 54bf28cd3..8187ccbf2 100644 --- a/src/server/Worker.ts +++ b/src/server/Worker.ts @@ -16,6 +16,7 @@ import { PartialGameRecordSchema, ServerErrorMessage, } from "../core/Schemas"; +import { replacer } from "../core/Util"; import { CreateGameInputSchema, GameInputSchema } from "../core/WorkerSchemas"; import { archive, finalizeGameRecord, readGameRecord } from "./Archive"; import { Client } from "./Client"; @@ -340,7 +341,9 @@ export async function startWorker() { // Ignore ping return; } else if (clientMsg.type !== "join") { - log.warn(`Invalid message before join: ${JSON.stringify(clientMsg)}`); + log.warn( + `Invalid message before join: ${JSON.stringify(clientMsg, replacer)}`, + ); return; }