Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Yigit, do you have time to fix it?
reemission of the same liveData is racy
reemission of the same liveData is racy
an...@google.com <an...@google.com> #4
Thanks for the detailed analysis. This may not be an issue anymore since we've started using Main.immediate there but I' not sure; I'll try to create a test case.
Description
Version used: 1.2.0-rc02
When the FragmentActivity hits onSaveInstanceState(), FragmentActivity moves all of the FragmentManagers to STOPPED, as expected.
However, it is expected that Lifecycle changes are always nested:
- Parent ON_START
- Child ON_START
- Parent ON_RESUME
- Child ON_RESUME
---
- Child ON_PAUSE
- Parent ON_PAUSE
- Child ON_STOP
- Parent ON_STOP
But in the case of onSaveInstanceState() it appears that the markState() method stops the parent Fragments first before the children, breaking the nesting guarantee.
You can verify the correct ordering by calling remove on the parent Fragment - you'll see the proper nesting there.