Repository navigation
Fix WHOOP 4.0 HRV source selection - #2441
rodrigosa7 wants to merge 2 commits into
Conversation
|
Landed on main. Your two commits are there unchanged as The diagnosis was right, and it matches the shape #2423 settled on for Oura: when two sources cover the same beats, score ONE of them for the interval rather than splicing both and reading coverage above 1.0. What the follow-up mostly did was the rebase. Your base predates #2423 and #2457, and both touch the single read this changes. Taking either side of that conflict literally would have reverted a merged fix without saying so. The parity gate needed five findings dispositioned, and it is worth knowing that as submitted this branch would not have run it: One thing I checked and did not change. The A note on the two Hardware proof is still owed, as you say: a whole-night RMSSD on a 4.0 whose window carries both a type-47 offload and live BLE, with One known trade is recorded in #2478: promotion relabels only exact key matches, so a PARTIAL offload can leave un-promoted unlabelled rows that the all-or-nothing selection then drops, lowering coverage. The direction of failure is a refusal to score rather than a wrong number, and it is visible in the coverage line. |
What this PR does
Labels WHOOP 4.0 type-47 historical R-R intervals separately from the overlapping unlabelled live BLE feed. HRV reads now select the historical stream consistently across the requested window, with a fallback to legacy unlabelled rows when no historical data is available. Exact-key historical replays promote existing legacy rows, and analysis fingerprints change so cached nights are rescored.
This addresses the supplied WHOOP log where a plausible whole-night RMSSD was withheld because combined historical/live coverage was classified as
crossSecondOverCount.Type of change
How it was tested
swift testinPackages/WhoopProtocol: 788 tests passed, 1 corpus-dependent test skipped.swift testinPackages/WhoopStore: 609 tests passed.build-and-test, WhoopProtocol/WhoopStore tests, and macOS/iOS builds.testFullDebugUnitTest: app and tests compiled; 6,308 tests ran, 6 skipped, and 2RecoveryDriversTestcases failed (driverPointRoundingUsesNearestWithHalfTiesAwayFromZero,issue51NegativeHalfTieUsesDefaultArg8WithoutChangingScoreOrDriverFields). Those files are outside this change; the PR’s GitHub Actions Android job passed.Strandapp build passed with existing warnings in unrelated files.git diff --checkpassed.Checklist
StrandDesigntokens — no UI changes.docs/CONTRIBUTING.md.Strand.xcodeproj/) or any secrets/keystores.Related issues
Refs #2335, #1118, #2336