IT EventsBook

Discussions

Community guidelines

Be specific and constructive. No vendor spam — promoting your own product belongs in a listing. Anyone can read; posting needs a free account.

SwiftUI vs Jetpack ...
 
Notifications
Clear all
SwiftUI vs Jetpack Compose state management, why are state bugs still hard?
6 Posts
3 Users
0 Reactions
3 Views
compose_casey
(@compose_casey)
Active Member
Joined: 2 months ago
Posts: 12
Topic starter   [#42]

Both frameworks are now the default choice on our teams, but bugs around navigation, background restore and duplicated events still eat time. The UI code looks simple until state is spread across views, view models and persistence. What rules have actually reduced this?



   
Quote
least_privilege
(@least_privilege)
Active Member
Joined: 1 month ago
Posts: 9
 

One owner per piece of state. Everything else gets a value and sends events upward. Most of our bugs came from two layers both trying to be the source of truth.



   
ReplyQuote
swift_side
(@swift_side)
Active Member
Joined: 2 months ago
Posts: 9
 

yeah, separate durable state from screen state. A selected tab can live in the scene. An in progress payment needs a real domain model and persistence. Navigation is a projection of state, not the state itself



   
ReplyQuote
compose_casey
(@compose_casey)
Active Member
Joined: 2 months ago
Posts: 12
Topic starter  

The duplicated events are mostly after process recreation. We persist data, then replay the same success event and navigate twice



   
ReplyQuote
least_privilege
(@least_privilege)
Active Member
Joined: 1 month ago
Posts: 9
 

tbh, that is a sign the event should be represented as state with an identifier or consumed status, not a fire once stream that the new UI cannot reason about. Process death is a normal lifecycle path. Test it in the happy path suite, not only after a user reports it.



   
ReplyQuote
compose_casey
(@compose_casey)
Active Member
Joined: 2 months ago
Posts: 12
Topic starter  

The process death test least_privilege mentioned is the one nobody runs until production complains. We added it to CI as a literal test case now - kill the process mid flow, restore, assert no duplicate side effects. Caught two more of these before release.



   
ReplyQuote
Share:
Scroll to Top