mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 22:26:13 +00:00
refactor(google-health): read and write backfill progress through one schema
The backfillProgress column was read by four hand-rolled walkers over untyped records and written inline in the sync core. One module now owns the column: a Zod schema reads it, lenient per entry so a malformed cursor or end is dropped on its own, and one function writes it. The sync core keeps only the bookkeeping of a running backfill.
This commit is contained in:
1 parent
435099dc4f
commit
bfbd88b30b
10 files changed
+342
-316
No files matched your search
@@ -3,7 +3,7 @@ import { apiHandler, requireAuth } from "@/lib/api-handler";
|
||||
import { annotate } from "@/lib/logging/context";
|
||||
import { apiSuccess } from "@/lib/api-response";
|
||||
import { loadOneConnectionHealth } from "@/lib/integrations/connection-health-load";
|
||||
import { googleHealthBackfillEndedList } from "@/lib/google-health/sync-core";
|
||||
import { googleHealthBackfillEndedList } from "@/lib/google-health/backfill-progress";
|
||||
|
||||
/**
|
||||
* Get Google Health connection status for the current user (v1.26.0).
|
||||
|
||||
@@ -55,7 +55,7 @@ import { loadConnectionHealth } from "@/lib/integrations/connection-health-load"
|
||||
import {
|
||||
googleHealthBackfillEndedList,
|
||||
type GoogleHealthBackfillEndedEntry,
|
||||
} from "@/lib/google-health/sync-core";
|
||||
} from "@/lib/google-health/backfill-progress";
|
||||
import type { ConnectionHealth } from "@/lib/integrations/connection-health";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
Reference in new issue
Block a user