From d4f2342fa3a9104d150e46d4eb60bd8ea3266aef Mon Sep 17 00:00:00 2001 From: Andres Date: Fri, 11 Apr 2025 03:16:26 +0200 Subject: [PATCH] add logs for neatqueue weird response breaking the sync --- src/server/api/routers/history.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server/api/routers/history.ts b/src/server/api/routers/history.ts index d85dd72..881543a 100644 --- a/src/server/api/routers/history.ts +++ b/src/server/api/routers/history.ts @@ -46,10 +46,17 @@ export async function syncHistory() { const firstGame = Object.keys(matches).sort( (a, b) => Number.parseInt(a) - Number.parseInt(b) )[0] + if (!firstGame) { throw new Error('No first game found') } - + if (firstGame === 'detail') { + await db.insert(metadata).values({ + key: 'history_cursor_failure', + value: JSON.stringify(matches), + }) + throw new Error('Something went wrong') + } await db .insert(metadata) .values({