Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Fix stale timeout message and deduplicate duration parsing - #1

Open
TadiMadz wants to merge 1 commit into
b-nnett:mainfrom
TadiMadz:fix/small-maintainability-improvements
Open

Fix stale timeout message and deduplicate duration parsing#1
TadiMadz wants to merge 1 commit into
b-nnett:mainfrom
TadiMadz:fix/small-maintainability-improvements

Conversation

@TadiMadz

@TadiMadz TadiMadz commented Jun 2, 2026

Copy link
Copy Markdown

What

Two small maintainability fixes, no behaviour changes.

1. CodexEmbeddedAuth.swift — timeout message now derived from its constant

The error thrown when device-code login times out hardcoded the string "15 minutes" rather than reading from maxDeviceCodeWaitSeconds. If the constant were ever bumped the message would silently show the wrong value.

Before:

throw CodexSelfContainedAuthError.invalidResponse("Device code login timed out after 15 minutes.")

After:

throw CodexSelfContainedAuthError.invalidResponse("Device code login timed out after \(maxDeviceCodeWaitSeconds / 60) minutes.")

2. GooseAppModel.swift — deduplicate env-var / CLI-flag duration parsing

The same ProcessInfo lookup pattern (check env var → check CLI flag → return default) was copy-pasted verbatim four times for the four auto-start capture durations. A fix or edge case would have to be applied to all four independently.

Extracted into a private nonisolated static func durationFromEnvironment(envVar:cliPrefix:fallback:). Each call site is now a single self-documenting expression. Behaviour is identical.

Test plan

  • Build succeeds (no API changes, pure refactor + string fix)
  • Device-code login timeout surfaces the correct duration in the error message if maxDeviceCodeWaitSeconds is changed
  • Auto-start capture durations resolve correctly from env vars and CLI flags as before

CodexEmbeddedAuth: the device-code timeout error message hardcoded "15
minutes" instead of deriving the value from maxDeviceCodeWaitSeconds.
If the constant were ever changed the message would silently lie.

GooseAppModel: the environment-variable + CLI-flag parsing pattern for
capture durations was copy-pasted four times. Extract it into a private
nonisolated static helper (durationFromEnvironment) so the logic lives
in one place and each call site reads as self-documenting data.
@KingPsychopath

Copy link
Copy Markdown

+1 works for me

goamorim added a commit to goamorim/goose that referenced this pull request Jun 3, 2026
tigercraft4 referenced this pull request in tigercraft4/goose Jun 3, 2026
tigercraft4 referenced this pull request in tigercraft4/goose Jun 3, 2026
…osure

- main.py: remove user-supplied body.device from log entry (log injection)
- main.py: return type(exc).__name__ instead of str(exc) (stack trace exposure)
- daily.py: remove device_id from warning log entry (log injection)

Fixes CodeQL alerts #1, #2, #3
tigercraft4 referenced this pull request in tigercraft4/goose Jun 5, 2026
tigercraft4 referenced this pull request in tigercraft4/goose Jun 5, 2026
…osure

- main.py: remove user-supplied body.device from log entry (log injection)
- main.py: return type(exc).__name__ instead of str(exc) (stack trace exposure)
- daily.py: remove device_id from warning log entry (log injection)

Fixes CodeQL alerts #1, #2, #3
mitchellfgibson added a commit to mitchellfgibson/whoop that referenced this pull request Jun 15, 2026
…ements

Fixes the stale "March 2025" data bug and adds three UX improvements on top of
NOOP v2.6.2, with the custom HMM sleep stager preserved.

1. Live front-page metrics (bug fix): the long-format metricSeries table — read
   by Explore and per-metric trends — was only ever written by the WHOOP CSV
   import, so RHR/HRV/recovery/skin-temp/resp/strain/sleep were frozen at the
   last import (March 2025) even while the strap streamed fresh data nightly.
   Repository now projects the COMPUTED daily metrics (rolled up from the live
   strap) into metricSeries under the computed source, and series() merges
   computed-over-imported so recent days read live. Verified: rhr/hrv now fresh
   to 2026-06-13 (was 2025-03).

2. Explore shows live last-2-weeks data (delivered by b-nnett#1's merged read).

3. Sleep: each metric tile (Rest/Efficiency/Consistency/Hours-vs-Needed/
   Restorative/Respiratory/Sleep-Debt) is now tappable, pushing that metric's
   full trend/history (MetricDetailView) via a NavigationStack.

4. Settings: a footer with two data points — "Data up to <date · relative>"
   (latest strap sample) and a live sync state (Syncing… N chunks / up to date /
   idle / not connected).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mitchellfgibson added a commit to mitchellfgibson/whoop that referenced this pull request Jun 15, 2026
b-nnett#1 (v3.9.0): drop the misleading SpO₂ chip and add an honest WHOOP 5/MG
capability block to the Settings strap card — what the band actually captures
over BLE, which NOOP scores it powers, and a footnote stating no SpO₂ % comes
off the strap (raw red/IR only; real % is import-only). Adapted from upstream
DeviceCapabilityProfile; derived directly since this app targets 5/MG.

b-nnett#2 (v2.18.0): add Export raw sensor data (CSV) to Settings → Experimental.
New WhoopStore.exportRawCSV dumps the last 24h of every decoded per-sample
stream (hr, rr, gravity, steps, ppghr, spo2 red/ir, skintemp, resp, events)
to one long-format CSV — the instrument for inspecting/reverse-engineering the
empty SpO₂ register. Save (macOS) / share (iOS) via the existing pattern.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants