mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 04:32:42 +00:00
The measurements unique index on (userId, type, source, externalId) is FULL — it covers soft-deleted rows — so a tombstoned Google row permanently owned its key: the live-only probe treated it as absent, planned a fresh insert, and createMany's skipDuplicates dropped that insert silently against the tombstone's key. Every sync, forever. Live incident: a self-hoster's step days were stuck exactly this way (five tombstoned dates, confirmed in their data). The probe now matches tombstoned rows too and the update branch carries deletedAt: null unconditionally — a no-op on a live row, a deliberate resurrection on a tombstoned one. Google remains the source of truth for its own rows; removing Google data permanently means disconnecting the integration. The stale 'partial unique index' comments are corrected.
954 KiB
954 KiB