Repository navigation
Fix premature WHOOP historical sync completion causing data loss - #2
Merged
Merged
Conversation
The historical backfill was being marked complete as soon as any realtime data frame (0x28/0x2B) arrived, even though the strap interleaves realtime HR summary frames with ongoing historical batch delivery. This caused the sync to disconnect almost immediately after connecting, before any real historical data was transferred, matching the observed connect -> packet exchange -> disconnect -> no data behaviour. The completion signal now relies solely on the strap's explicit historical-sync-complete metadata marker. Also close a related race in WhoopRecordingService where the record collector job was cancelled immediately on stop, potentially dropping records still sitting in the buffer; it now disconnects first, gives the collector a moment to drain, then joins the cancellation. https://claude.ai/code/session_01J194Wop2SixMd1HPS5PbcS
The CI workflow runs `chmod +x ./gradlew` and `./gradlew :app:assembleDebug`, but the Unix gradlew script was never committed (only gradlew.bat existed), and gradle-wrapper.jar was excluded via .gitignore with no step in CI to regenerate it. Every previous run of the Android Debug APK workflow on master failed at the same chmod step for this reason. Generated the wrapper files for the gradle-wrapper.properties-pinned version (8.13) and committed them, which is standard practice for the Gradle wrapper. https://claude.ai/code/session_01J194Wop2SixMd1HPS5PbcS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The historical backfill was being marked complete as soon as any
realtime data frame (0x28/0x2B) arrived, even though the strap
interleaves realtime HR summary frames with ongoing historical batch
delivery. This caused the sync to disconnect almost immediately after
connecting, before any real historical data was transferred, matching
the observed connect -> packet exchange -> disconnect -> no data
behaviour. The completion signal now relies solely on the strap's
explicit historical-sync-complete metadata marker.
Also close a related race in WhoopRecordingService where the record
collector job was cancelled immediately on stop, potentially dropping
records still sitting in the buffer; it now disconnects first, gives
the collector a moment to drain, then joins the cancellation.
https://claude.ai/code/session_01J194Wop2SixMd1HPS5PbcS