feat(kobo): add device sync history tracking

Records success and failure events for Kobo device syncs in the database, including operation duration, event types, and error details. Surfaces the recent sync history in the Kobo Settings UI for users to monitor their device activity.
This commit is contained in:
neon
2026-07-03 00:54:01 +00:00
parent 13be42792d
commit 6fdd2569e1
22 changed files with 14601 additions and 119 deletions
+19
View File
@@ -19,6 +19,25 @@ export interface KoboSyncSettings {
syncBookOrbitAnnotationsToKobo: boolean;
}
export type KoboSyncHistoryEvent = "library_sync" | "book_download" | "progress_update" | "annotations_pull" | "annotations_push";
export type KoboSyncHistoryStatus = "success" | "failed";
export type KoboSyncHistoryCounts = Record<string, number | boolean | string | null>;
export interface KoboSyncHistoryEntry {
id: number;
deviceId: number | null;
deviceName: string | null;
event: KoboSyncHistoryEvent;
status: KoboSyncHistoryStatus;
counts: KoboSyncHistoryCounts;
durationMs: number;
errorClass: string | null;
error: string | null;
createdAt: string;
}
export interface CreateKoboDeviceRequest {
name: string;
}