Skip to content

Debug export: Alarm block + honest "armed" log (#34) - #37

Merged
ryanbr merged 3 commits into
mainfrom
alarm-debug-and-armed-log
Jul 7, 2026
Merged

ryanbr merged 3 commits into
mainfrom
alarm-debug-and-armed-log

Conversation

@ryanbr

@ryanbr ryanbr commented Jul 7, 2026

Copy link
Copy Markdown
Owner

From #34 (alarm not buzzing) — the strap consistently reported a stale armed time no matter what NOOP sent (its clock was reset). The #401 readback caught it, but nothing surfaced it, and the log even claimed "armed" while disconnected.

#3 — Alarm block in the debug export (both platforms)

The configured wake + the last arm's sent-vs-strap-reports epochs with a MISMATCH flag, so a "didn't buzz" report is decidable at a glance:

── Alarm ──
Enabled: yes · set 07:00
Last arm: sent 2026-07-07 21:24 · 3m ago · strap NOT connected (queued)
Strap reports: 2021-03-28 04:07  ⚠️ MISMATCH — strap didn't accept the time

armStrapAlarm persists the sent epoch (+ when + connected); the GET_ALARM_TIME readback persists what the strap reports; the export composes them (best-effort, guarded).

#4 — don't log "armed" when disconnected

The old log said send(Set Alarm Time) ignored — not connected then immediately Alarm: armed. Now it logs "queued — will send on next connect" when connectedPeripheralUUID/_state.connected is nil, so the log stops claiming an arm that never transmitted.

Scope

  • iOS: BLEManager (arm persist + gate), FrameRouter (readback persist), DebugDataDiagnostics (block).
  • Android: WhoopBleClient (arm persist + gate + readback persist), AndroidDiagnostics (block).
  • Android compiles clean; iOS gated by CI (touches the BLE path, can't build Swift locally).

ryanbr added 3 commits July 7, 2026 23:55
From #34 (alarm not buzzing): the strap consistently reported a STALE armed time regardless
of what NOOP sent (its clock was reset) — the #401 readback caught it, but nothing surfaced
it and the log even claimed 'armed' while disconnected.

#3 — Alarm block in the debug export (both platforms): the configured wake + the last arm's
  sent-vs-strap-reports epochs with a MISMATCH flag, so a 'didn't buzz' report is decidable at
  a glance. armStrapAlarm persists the sent epoch (+ when + connected); the GET_ALARM_TIME
  readback persists what the strap reports; the export composes them (best-effort, guarded).

#4 — don't log 'Alarm: armed' when the strap isn't connected (the SET was dropped). Log
  'queued — will send on next connect' instead, so the log stops claiming an arm that never
  transmitted.

Both platforms (iOS BLEManager/FrameRouter/DebugDataDiagnostics; Android WhoopBleClient/
AndroidDiagnostics). Android compiles clean; iOS gated by CI.
…ck skew

Rounds out the Alarm block to cover the full alarm-failure matrix, not just 'didn't stick':
- #1 last fired: persist STRAP_DRIVEN_ALARM_EXECUTED → 'Last fired: Nh ago / never observed'
  (the 'did the strap actually buzz?' leg of the armed→reports→fired sequence).
- #3 model + 5/MG experimental gate → 'Model: 5.0/MG · experimental: off → NOT armed', the #1
  '5/MG alarm never fires' cause (silently gated off).
- #4 strap clock skew: persist the newest banked record → 'Strap clock: 446d behind (reset)',
  the actual #34 root cause, surfaced instead of buried in the CLOCK-WARNING log line.

Now the block triages: didn't arm (model/experimental/connected), didn't stick (sent-vs-
reports + clock), didn't fire (last-fired). Both platforms; persists at low-frequency points
(fired event, GET_DATA_RANGE). Android compiles clean; iOS gated by CI.
The iOS #3 model line compared selectedWhoopModel against "whoop5", but the
stored WhoopModel rawValue is "WHOOP 5.0 / MG" — so every iOS user (incl.
5/MG) showed "Model: WHOOP 4.0" and the experimental-gate hint never rendered.
Compare against WhoopModel.whoop5mg.rawValue and print the real model name.

Clock-skew (#4) only flagged a clock BEHIND wall; a future-dated strap clock
(the #928 case, equally breaks the alarm) showed "OK". Flag AHEAD too.
@ryanbr
ryanbr merged commit 21d4550 into main Jul 7, 2026
4 checks passed
@ryanbr
ryanbr deleted the alarm-debug-and-armed-log branch July 14, 2026 10:49
DX23876 referenced this pull request in DX23876/noop Jul 22, 2026
Debug export: Alarm block + honest "armed" log (#34)
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