fix(kobo): track library snapshots and sync progress per device

Migrate the snapshot and snapshot books tables to be per-device instead
of per-user. This resolves a sync race condition where only the first
registered Kobo device for a user receives the library delta, leaving the
others empty.

Closes #314
This commit is contained in:
neon
2026-07-09 20:57:02 +00:00
parent 729b221427
commit 5541e1acdc
26 changed files with 28286 additions and 271 deletions
+20 -5
View File
@@ -9,11 +9,7 @@ export const E2E_GLOBAL_CHANGE_PATHS = Object.freeze([
"docker/**",
]);
const SHARED_DB_AND_HELPER_PATHS = Object.freeze([
"server/src/db/schema/**",
"scripts/e2e/**",
"scripts/db/**",
]);
const SHARED_DB_AND_HELPER_PATHS = Object.freeze(["server/src/db/schema/**", "scripts/e2e/**", "scripts/db/**"]);
const SHARED_AUTH_TYPE_PATHS = Object.freeze(["packages/types/src/auth.ts", "packages/types/src/permissions.ts"]);
@@ -481,6 +477,25 @@ export const E2E_SUITES = Object.freeze({
...SHARED_DB_AND_HELPER_PATHS,
],
},
"kobo-multi-device-sync": {
id: "kobo-multi-device-sync",
name: "Kobo Multi-Device Sync",
timeout: 60,
lane: "full",
description: "Kobo device-owned library snapshot suite",
vitestTarget: "test/kobo-multi-device-sync.e2e-spec.ts",
junitOutput: `${TEST_RESULTS_DIR}/kobo-multi-device-sync-e2e-junit.xml`,
prepareDedicatedDatabase: true,
useDedicatedDatabase: true,
changedPaths: [
"server/src/modules/kobo/**",
"server/src/modules/book/**",
"server/test/kobo-multi-device-sync.e2e-spec.ts",
"server/test/e2e/reader-state-isolation/**",
"packages/types/src/book.ts",
...SHARED_DB_AND_HELPER_PATHS,
],
},
"users-admin-lifecycle": {
id: "users-admin-lifecycle",
name: "Users Admin Lifecycle",