fix(kobo): reconcile counter estimates on their counter interval (#1796)

fix(kobo): reconcile counter estimates on their counter interval (#1796)

Stop counting offline Kobo reading twice. Record when each counter
estimate's interval began, split measured sessions across intervals by
wall-clock overlap, and subtract measured seconds instead of dropping the
estimate, so both arrival orders converge.

Closes #1667

Co-authored-by: neon <18559658+neonsolstice@users.noreply.github.com>
This commit is contained in:
François-Xavier Payet
2026-10-17 01:33:05 +02:00
committed by GitHub
parent d0da80e751
commit 7f12e8cd6d
11 changed files with 24707 additions and 99 deletions
+19
View File
@@ -1080,6 +1080,25 @@ export const E2E_SUITES = Object.freeze({
...SHARED_DB_AND_HELPER_PATHS,
],
},
"kobo-reading-time-reconciliation": {
id: "kobo-reading-time-reconciliation",
name: "Kobo Reading Time Reconciliation",
timeout: 45,
lane: "full",
description: "Kobo counter-derived estimate and measured session reconciliation suite",
vitestTarget: "test/kobo-reading-time-reconciliation.e2e-spec.ts",
junitOutput: `${TEST_RESULTS_DIR}/kobo-reading-time-reconciliation-e2e-junit.xml`,
prepareDedicatedDatabase: true,
useDedicatedDatabase: true,
changedPaths: [
"server/src/modules/kobo/**",
"server/src/modules/reading-session/**",
"server/src/common/utils/reading-daily-stats.utils.ts",
"server/test/kobo-reading-time-reconciliation.e2e-spec.ts",
"server/test/e2e/reader-state-isolation/**",
...SHARED_DB_AND_HELPER_PATHS,
],
},
"kobo-cover-identity": {
id: "kobo-cover-identity",
name: "Kobo Cover Identity",