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
+3 -1
View File
@@ -217,6 +217,8 @@ export type BookKoboReadingState = {
};
export type BookKoboSnapshotState = {
deviceId: number;
deviceName: string;
snapshotId: number;
snapshotUpdatedAt: string;
inSnapshot: boolean;
@@ -232,7 +234,7 @@ export type BookKoboState = {
eligibleForKoboSync: boolean;
syncCollections: string[];
readingState: BookKoboReadingState | null;
snapshot: BookKoboSnapshotState | null;
snapshots: BookKoboSnapshotState[];
};
export type BooksPage = {