badoo / RIBs

Badoo's take on RIBs
Apache License 2.0
162 stars 50 forks source link

View is not attached after restoring from Bundle #359

Closed Nublo closed 2 years ago

Nublo commented 2 years ago

To reproduce we need to have next setup:

|--> MainContainerRIB
|--|--> ChildContainerRIB1
|--|--|--> ChildRib1
|--|--> ChildRIB2
  1. Enable Don't keep activities
  2. Start with ChildContainerRIB1.ChildRIB1 configuration
  3. Push ChildRIB2 configuration
  4. Hide/unhide application to trigger saving configuration in Bundle
  5. Reopen app
  6. Move back to ChildContainerRIB1.
  7. ChildRIB1 view is not attached.

Explanation of what is happening:

com.badoo.ribs.routing.state.feature.state.WorkingState.toSavedState()
...
!pendingDeactivate.contains(entry.key) -> original
   else -> original.withActivationState(
      activationState = RoutingContext.ActivationState.INACTIVE
)
...

Solution proposed is to cleanup pendingDeactivate and pendingRemoval when receiving Removed|Activated|Deactivated effects.