fix(oura): skip rejected and deleted sleep periods

Oura returns detected periods the person dismissed (type rest) and ones
they deleted in the sleep collection. They were imported as sleep, with
their lowest heart rate, HRV and breathing rate, which added an extra
session to the day. They now map to nothing, and rows an earlier sync
stored for such a period are soft-deleted on the next sync through the
shared write tail.
This commit is contained in:
Marc-André Bombeck committed 2026-10-15 15:10:18 +02:00
1 parent d7588fe9bf
commit 35a33ca173
6 files changed
+296 -2

No files matched your search

@@ -51,6 +51,8 @@ const WRITE_SITES: Record<string, string> = {
"lib/measurements/create-from-telegram.ts": TAIL,
"lib/whoop/sync-body.ts": TAIL,
"lib/whoop/webhook-handler.ts": TAIL,
// Retiring the rows of Oura sleep periods the person rejected or deleted.
"lib/oura/sync.ts": TAIL,
// Integration syncs: each collects the (type, day) pairs it touched and
// runs both legs itself at the end of the sync.
"lib/fitbit/sync-core.ts":