The catalog screen has a row with active filters and a counter of found items. After a recent change, the behavior became unstable: when leaving the page and returning, the UI sometimes shows stale data, and some updates continue to arrive when the View should no longer be active.
countView;chipsView.Flow<FilterUiState> in the ViewModel.viewLifecycleOwner lifecycle.View is not at least in the STARTED state, UI updates must not be applied.View is recreated, the fragment must not retain old active collectors that continue updating the destroyed UI.Fragment remains in the back stack.View is active.countView and chipsView.View.org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1androidx.fragment:fragment-ktx:1.8.2androidx.lifecycle:lifecycle-runtime-ktx:2.8.4androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4Fragment + XML, without ComposeFragment stays in the back stack, and its View can be recreated separately from the Fragment instancestate stream is hot and may emit values while the screen is not visibleUse line comments to explain the problem, its impact, the fix and how to test it.