Skip to content

Heart v1.0.10 — Stale sleep summaries auto-recompute

Choose a tag to compare

@pointbreaklab-byte pointbreaklab-byte released this 09 May 13:55

What's fixed

Sleep card empty for past nights, even though raw HR was recorded

Root cause: SleepSummaryStore (the SharedPreferences cache the UI reads from) was only ever written by the Android native service, which used a different and historically buggier HR-threshold formula (p15 + 12 with no cap). When v1.0.6 fixed the Dart JsonlSleepStager, that fix never propagated to cached summaries — the Dart stager wasn't a writer of the cache. Result: nights computed by the legacy native formula stayed stuck at 0 minutes even after the app was upgraded.

Two-part fix

  1. New SleepSummaryRefresher runs at app launch and on resume. For each of the last 7 nights it executes the (now-correct) Dart JsonlSleepStager directly against the raw heart_samples/*.jsonl files and overwrites whatever was cached. The dependent providers (yesterdaySleepProvider) are invalidated so the UI redraws immediately. Cost: ~7 stager runs at launch — bounded by sample-file size, sub-second on a phone.
  2. Native Kotlin computeSleepSummary now uses the Dart-equivalent formula: min(p15, max(restingBpm, 75)) + 8 instead of p15 + 12. Also reads the personalised resting BPM from prefs (default 64) instead of treating every user the same. Future nights computed by the background service while the app is closed will now match what the Dart stager would produce.

After upgrading, open the app once — the missing nights will appear within seconds.

Build

  • heart-android.apk — arm64-v8a split, 22 MB. SHA-256: c0e99b7cedcc9b9bbe028e4d907ff3b2548344305d20eeb3512a1091a5a7b6d2
  • heart-android-universal.apk — fat APK, 62 MB. SHA-256: 7b191b42ebecd3f797ce74d85aae3cfb29b4012add98913a62ac3a32e7d53d1b
  • Same release certificate as every prior version — clean upgrade.