From 06eb5b78b0998ff3b4a73160ec3abf30125ffe88 Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 10 Jun 2026 12:20:15 +0200 Subject: [PATCH 1/2] chore: remove last space in legacy code --- frontend/src/ts/test/test-stats.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/test/test-stats.ts b/frontend/src/ts/test/test-stats.ts index 24895fe2dd41..2bec988f6bd9 100644 --- a/frontend/src/ts/test/test-stats.ts +++ b/frontend/src/ts/test/test-stats.ts @@ -283,9 +283,16 @@ function countChars(final = false): CharCount { for (let i = 0; i < inputWords.length; i++) { const inputWord = inputWords[i] as string; - const targetWord = targetWords[i] as string; + let targetWord = targetWords[i] as string; const isLastInputWord = i === inputWords.length - 1; + // getTargetWords appends a delimiter to every word except the last in the + // generated list; for the last input word (active in timed/mid-test, or + // the actual last word) drop that delimiter so overshoot counts as extra + if (isLastInputWord && targetWord.endsWith(" ")) { + targetWord = targetWord.slice(0, -1); + } + const { correctWord, allCorrect, incorrect, missed, extra } = countCharsUtils( inputWord, From 6f16874dcad10ccbbc1627081dc2408179d4eac4 Mon Sep 17 00:00:00 2001 From: Miodec Date: Wed, 10 Jun 2026 12:44:08 +0200 Subject: [PATCH 2/2] chore: bump version --- frontend/src/ts/test/test-logic.ts | 2 +- packages/contracts/src/results.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts index c337c1eac706..bffe58acc906 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -1317,7 +1317,7 @@ function compareCompletedEvents( difficulty: ce.difficulty, duration: ce.testDuration, funboxes: getActiveFunboxNames().join(","), - version: 16, + version: 17, data: { words: TestWords.words.list.join(" "), events: getAllTestEvents(), diff --git a/packages/contracts/src/results.ts b/packages/contracts/src/results.ts index 1b1a0bf28214..287eb5b1433c 100644 --- a/packages/contracts/src/results.ts +++ b/packages/contracts/src/results.ts @@ -75,7 +75,7 @@ export const ReportCompletedEventMismatchRequestSchema = z.object({ difficulty: DifficultySchema.optional(), duration: z.number().max(200).optional(), funboxes: z.string().max(100).optional(), - version: z.literal(16), + version: z.literal(17), data: z.object({ words: z.string().max(10000), events: z.array(z.record(z.unknown())),