Skip to content

fix(storage): count stepSample + ppgHrSample in the decoded-rows footprint - #1398

Merged
ryanbr merged 1 commit into
mainfrom
fix/storagestats-missing-streams
Aug 17, 2026
Merged

ryanbr merged 1 commit into
mainfrom
fix/storagestats-missing-streams

Conversation

@ryanbr

@ryanbr ryanbr commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Small correctness + parity nit noticed while reviewing DB storage.

The Test-Centre storage footprint under-reports decoded rows:

  • Swift storageStats() summed only 8 of 10 decoded raw streams — omitting stepSample and ppgHrSample.
  • Android storageRowCounts() had steps but omitted ppgHrSample.

Both are real accumulating decoded streams (purged by TimestampHeal / device-forget alongside the others), and ppgHrSample — the v26 PPG-derived per-second HR (#156) — can bank millions of rows on a WHOOP 4.0, so the omission materially under-counts the footprint that surface exists to report.

Change: add stepSample + ppgHrSample to the Swift sum, add ppgHr to the Android map — so both platforms count all 10 raw tables. Extended the ReadTests footprint assertion 12 → 14 (now seeding a stepSample + ppgHrSample so a future regression is caught).

Diagnostic-only — no scoring / stored-data / BLE / UI-logic change. Pure data-layer, so swift-packages + Android CI fully cover it (no app-build gate). Android validated locally (compile clean).

…f 14)

`storageStats()` (Swift) and `storageRowCounts()` (Android) hand-listed a subset
of the decoded raw stream tables, so the Test-Centre "decoded rows" footprint
under-reported. Swift summed 8 of 14, Android 9 of 14; both omitted
`ppgHrSample`, `sleepStateSample`, `ppgWaveformSample`, `rawImuSample`,
`v18AuxSample` (Swift also `stepSample`) — and ppgHr/ppgWaveform/rawImu can each
bank a lot of rows on a WHOOP 4.0.

Count all 14 accumulating raw tables on both platforms, matching the canonical
`TimestampHeal.rawTables` purge list (Swift now iterates that list rather than a
fixed expression, so a future raw table can't silently drop out; comments on both
sides point at the canonical list). Extended `ReadTests` to seed one row in every
stream (incl. rawImu) and assert 18 decoded rows across all 14 tables.

Diagnostic-only; no scoring/stored-data/BLE/UI-logic change.
@ryanbr
ryanbr force-pushed the fix/storagestats-missing-streams branch from 1f38afe to c8733f5 Compare August 17, 2026 02:34
@ryanbr
ryanbr merged commit 70b5ad5 into main Aug 17, 2026
14 checks passed
@ryanbr
ryanbr deleted the fix/storagestats-missing-streams branch August 17, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant