From addd6b7000c708f03cded77ce49e05e1ef01c943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 29 Jul 2026 14:47:47 +0200 Subject: [PATCH] fix(01-19): avoid phantom ECG failure counts - increment archive-level failures only for discovered ECG artifacts --- src/lib/jobs/apple-health-import-worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/jobs/apple-health-import-worker.ts b/src/lib/jobs/apple-health-import-worker.ts index 4a492a9aa..542ecb941 100644 --- a/src/lib/jobs/apple-health-import-worker.ts +++ b/src/lib/jobs/apple-health-import-worker.ts @@ -396,7 +396,7 @@ export async function handleAppleHealthImport( } } catch { const completed = ecg.imported + ecg.updated + ecg.skipped + ecg.failed; - ecg.failed += Math.max(1, ecg.discovered - completed); + ecg.failed += Math.max(0, ecg.discovered - completed); } // Done. Persist the terminal envelope.