I've found a bug where a router push event is ignored when performed during an ongoing navigation.
I haven't migrated to the latest Kotlin yet, so I'm still on Decompose 0.1.7
, and Kotlin 1.4.21-2
Here is the situation:
I have a RootComponent
, which has 3 child components, A
, B
, and C
.
We start the app by displaying A
where an auth occurs
router.navigate { listOf(Screen.A) }
After the user logs in, we navigate to Screen B
, and remove A
from the backstack:
router.navigate { listOf(Screen.B) }
Inside of Component B
, I was trying to debug something and so I called
init {
lifecycle.doOnResume {
resumePauseLaunch { loadData() }
output(Output.ActionThatNavigatesToC)
}
}
Which ultimately triggers this in the root component:
Even though C
is the last screen pushed to, the View isn't updated and it just stays on Screen B
. Calling output(Output.ActionThatNavigatesToC)
after the screen transition to B has completed, works as intended.
Message me on Slack, and I can step you through the code if you'd like more details.