Skip to content

fix(android): retry failed Stress detail reads - #2725

Open
kavemang wants to merge 2 commits into
ryanbr:mainfrom
kavemang:agent/stress-core-retry-2535
Open

kavemang wants to merge 2 commits into
ryanbr:mainfrom
kavemang:agent/stress-core-retry-2535

Conversation

@kavemang

@kavemang kavemang commented Oct 8, 2026 •

Copy link
Copy Markdown

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

  • Bug fix

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 and testFullDebugUnitTest executed 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

  • Swift package tests pass for any package I touched (none touched)
  • Android unit tests pass (full upstream suite at exact head)
  • No new build warnings introduced (direct helper/test compilation emitted none; upstream logs report no warnings for the changed sources)
  • UI changes use only design tokens — no styling changed
  • No hardcoded hex frame bytes
  • Follows docs/CONTRIBUTING.md
  • No generated output or secrets committed

Related issues

Refs #2535

@kavemang
kavemang marked this pull request as ready for review October 8, 2026 03:53
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
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