Repository navigation
fix(power): enforce saving cadence for automatic sync triggers - #2837
Draft
fadkeprasad wants to merge 1 commit into
Draft
fadkeprasad wants to merge 1 commit into
fadkeprasad wants to merge 1 commit into
Conversation
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.
What this PR does
Power saving stretches the periodic history timer to 45 minutes, or 60 minutes with Low refresh, but Apple's live strap events still reach requestSync(.strap) through a 90-second floor. Repeated events can bypass the selected saving cadence.
Pass the active saving interval into BackfillPolicy.shouldRun on both platforms. Periodic and strap-event attempts use the greater of that interval and their existing empty-history backoff. Synthetic events every 90 seconds over two hours now permit starts at 3600 and 7200 seconds with Low refresh, rather than all 80 attempts.
Refs #1430.
Type of change
How it was tested
Hardware validation
Draft pending a charged WHOOP 5.0 run. Existing local strap logs show frequent event-triggered history attempts, but predate the saving-setting change and do not prove an energy benefit. This patch has not been installed on a phone or validated on a physical strap. No battery-life improvement or sole cause of an individual discharge is claimed. Raw health data and private logs are not included.
Checklist