Repository navigation
Conversation
kavemang
marked this pull request as ready for review
October 8, 2026 03:53
8 of 12 tasks
Retain the union-wide HR witness and cancellation guards while memoising only successful core reads. Cover alias backfill retries and late cancelled loads against the merged helper. Refs #2535
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
When Android's Stress detail core read fails once, its HR fingerprint currently gets marked as handled before the read succeeds. Later refresh ticks with unchanged HR skip the read, and the failure also replaces the chart with an empty result.
Memoise the fingerprint only after a successful core read and publish only that successful result. A failed read retains the current timeline and stays eligible on the next existing refresh tick. Successful empty reads still memoise; unknown fingerprints still force reads; coroutine cancellation propagates. The memo remains scoped to the screen's existing lifecycle effect.
This is a bounded retry fix, not a claim to remove #2535's first-load latency. Apple uses a different refresh path without this fingerprint gate, so no Apple change is needed. Scoring, stored values, BLE, and design tokens are unchanged.
Type of change
How it was tested
Four coroutine unit tests exercise the production refresh helper: failure followed by success with identical HR, retention and retry after a later failure, unknown fingerprints and successful empty results, and cancellation followed by a retry. Direct compilation of the actual helper and test sources using pinned Kotlin 1.9.24, JDK 17, coroutines 1.8.1 and JUnit 4.13.2 passed all four tests. The local cold/rerun Gradle workload did not complete: its parent exited during app compilation and its orphaned Kotlin compiler was stopped; no full local app compilation or Gradle unit pass is claimed. An eager-memo mutation restoring the original ordering fails three of the four tests. Upstream Android CI passed at exact head
89681dfd61d3063dcf4ca284b763ee897dd1af7b: KSP and app Kotlin compilation executed during the APK build (4m33s); test Kotlin compilation andtestFullDebugUnitTestexecuted during the unit leg (1m52s). App Kotlin/KSP were up-to-date at that same head during the test leg. All four expected checks passed: Android, Tools Python, source hygiene, and i18n. Tools passed 234 capture, 50 parity acceptance, 2 R-R preservation, and 153 core tests. No Apple/package checks are expected for this Android UI-only change. No real-device UI or strap validation claimed.Source hygiene, i18n diff audit against origin/main, and whitespace checks pass locally. The internal helper is in UI scope; no analytics/store declaration graph changes or parity snapshot edits.
Checklist
Related issues
Refs #2535