Repository navigation
fix(stress): discard results from cancelled screen loads - #2738
Merged
ryanbr merged 1 commit intoOct 9, 2026
Merged
Conversation
Author
|
Hi @ryanbr, could you take a look at this when you have time? It stops an older Stress refresh from replacing newer results, so the screen stays consistent while the strap syncs. The calculations and layout stay the same. I’ve installed the update on my iPhone with a WHOOP 5 and Stress looks normal; the before/after tests also reproduce the problem and confirm the fix. All checks are passing. |
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
A cancelled Stress screen refresh can finish after its replacement and overwrite the newer chart or advanced readouts. On Android,
runCatchingcan also turn cancellation into an empty failed-read fallback and publish it.Check cancellation before and after all seven Apple load phases and Android's stored-series, fingerprint and advanced-lens reads. Propagate Android cancellation while retaining ordinary failed-read fallbacks. Publish the Apple personal-lens flag together with its timeline. Normal values, read limits, task priorities, timeline-before-advanced rendering and layout stay the same. Already-running non-cooperative calculations can still finish; their cancelled result is discarded.
Android's core call is unchanged: #2725 already handles its cancellation as part of the separate retry fix. This PR keeps that work separate.
The existing personal-lens wiring test now checks preference forwarding and selected-mode scoring without depending on the exact assignment text.
Type of change
How it was tested
49777b94: 632 store / 2,135 analytics / 327 import tests, all source/i18n/parity checks, 127 governance tests, 2,273 Mac tests and iOS build. One existing import/two Mac skips. Final head only narrows the Kotlin core call and renames a test; all Apple inputs are byte-identical. Final source/package/parity gates rerun at63e19100.63e19100, with no warnings in changed Kotlin sources. Existing Swift Sendable warnings match the baseline; no new warnings.Checklist
swift testinPackages/<name>); packages unchanged, reference suites also runandroid/(./gradlew testFullDebugUnitTest)StrandDesigntokens — layout/tokens unchangeddocs/CONTRIBUTING.mdStrand.xcodeproj/) or any secrets/keystoresRelated issues
Refs #2725 (separate Android core retry/cancellation work).