Fix the crash on every cold start of a signed-in television.

MembyIcons' currentIconPack and DesignTokens' activePalette are process-wide
mutableStateOf. The first thing in the process to touch either was ThemeSync,
applying the cached pack and palette from an IO thread within milliseconds of
the settings store's first emission -- reliably after MainActivity had taken
its composition snapshot. A state object created in a newer snapshot than the
composition reading it makes that read throw, so HomeNavigation's first
MembyIcon.mark read died with "Reading a state that was created after the
snapshot was taken".

MembyApp.onCreate now creates both on the main thread before anything else can.
Both calls are value-level no-ops; what matters is the thread and the ordering.

It was invisible on a fresh install because first-run and sign-in draw no marks,
which is why clearing app data appeared to fix it -- and it looked like an update
bug only because replacing the APK is what forces a cold start with the launcher
as the first screen. A reboot did it too.

Also: AppRoot filtered neither read of the persisted requiredUpdateVersion
through requiredUpdateSatisfied, so a set that had just installed the demanded
version opened on the retired-build screen it was updating to escape, until a
/v1/update round trip completed. Both reads now apply the rule the in-memory
signal and markRequiredUpdate already did.

Verified on 10.0.0.238: three cold starts, no crash, launcher fully drawn.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HoEWidWhZu9kZzNURatmcT
This commit is contained in:
ponzischeme89
2026-08-24 09:58:09 +12:00
co-authored by Claude Opus 5
parent 067395a362
commit 1ae07b93ec
6 changed files with 52 additions and 3 deletions
+4
View File
@@ -1,3 +1,7 @@
## 0.3.17 - 2026-08-24
- Fixed: Crash on every cold start of a signed-in television. `MembyIcons`' icon-pack state and `DesignTokens`' palette state are process-wide `mutableStateOf`, and the first thing to touch either was `ThemeSync` applying the cached pack from an IO thread while the launcher was composing — so the state object was created in a snapshot newer than the composition reading it, and the navigation rail's first `MembyIcon.mark` read threw "Reading a state that was created after the snapshot was taken". `MembyApp.onCreate` now creates both on the main thread before anything else in the process can. Invisible on a fresh install because first-run and sign-in draw no marks, which is why clearing app data appeared to fix it.
- Fixed: A television that had just installed the version the gateway demanded opened on the retired-build screen it was updating to escape. `AppRoot` now filters the persisted `requiredUpdateVersion` through `requiredUpdateSatisfied`, the same rule the in-memory signal and `markRequiredUpdate` already apply.
## 0.2.98 - 2026-08-22
- v298 closes the following issues: 116 (Feature: Integrate Memby with Android TV Home Screen), 117 (Improve Row Navigation & Add “View All” Actions) and 115 (Add ratings strip to movie continue watching).
- Added: Continue Watching support on the Google TV launcher homescreen (116)