Skip to content

[codex] Treat data-receiving WHOOP backfills as partial success - #10

Merged
BarMal merged 1 commit into
masterfrom
codex/whoop-backfill-partial-success
Jun 20, 2026
Merged

BarMal merged 1 commit into
masterfrom
codex/whoop-backfill-partial-success

Conversation

@BarMal

@BarMal BarMal commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

The latest on-device backfill screenshot shows the strap is now sending historical data (150 history frames, 3 batches, 1 done), but the service still leaves the UI in Connection failed.

This PR fixes the service-level outcome handling for that case.

What changed

  • If historical sync throws after rows were persisted, events were persisted, or incoming historical rows were skipped because they already existed, the service now treats the run as a partial success instead of setting WhoopRuntimeState.ERROR.
  • Partial-success cleanup still closes the session, enqueues processing for any stored data, marks the sync finished, and stops the foreground service.
  • True no-data failures still surface as Connection failed.

Why

The BLE/debug counters prove data can arrive and completion can be observed even when a later cleanup/timeout path throws. In that case, marking the whole run as failed hides the useful result and leaves the debug screen red despite actual historical progress.

Validation

  • ./gradlew.bat :app:assembleDebug
  • ./gradlew.bat testDebugUnitTest

@BarMal
BarMal marked this pull request as ready for review June 20, 2026 10:26
@BarMal
BarMal merged commit 7796c23 into master Jun 20, 2026
1 check passed
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