Member-only story
Below the Waterline: Running Compose State Where There Is No Screen
A senior engineer’s tour of Jetpack AppState (Transform and StateStore), told through the bugs that only show up after launch.
Not a Medium Member? “Read For Free”
1. The trouble with state nobody is looking at
Picture Pedalpost, a bike-courier app (invented for this post). One fact, “the courier is standing at a customer’s door,” has to be true in four places at once: the dispatch screen, a foreground service, a home-screen widget, and a notification action. Add a battery-saver flag, a zone filter, and an order feed, and you have the usual Android state mess:
- A
combine(...)call that grows a sixth upstream and loses its typed overload. - A
MutableStateFlow<UiState>that wakes every collector when a single field changes, or a pile of separate flows that cannot be updated together. - A singleton, a
SharedPreferencesfile, and aSavedStateHandlethat each claim to own "the current delivery" and quietly disagree after process death. - Timers and notifications buried inside collectors, with cancellation rules nobody can recite.
Jetpack AppState attacks this from a direction that surprises people: it takes Compose’s snapshot state…










