bluelinelabs / bluelinelabs/Conductor

Calling setBackstack with an empty list has incorrect behavior

Open
#458 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.9k
Forks
338
PR merge metrics
No merged PRs in 30d

Description

Hey again, been a while!

Reporting in for versions **2.1.4** up to **SNAPSHOT**, a new project has found a really interesting issue with the `setBackstack` call. We're a little hard pressed for time to get a full sample and nail down the repro, but the situation is:

- You've got a controller with a child router being used.
- The parent targets the topmost view, the child controllers target sibling views.
- ~The child controller calls `setBackstack` with an empty list~ The *parent* controller calls `setBackstack` with an empty list on its *child's* router.
- **The last controller in the current Conductor stack never has its `onDetach` lifecycle method called**
_...But!..._
- Calling `popToRoot` / `popCurrent` works perfectly, and all controllers have their proper lifecycle methods called.

In our case, swapping `setBackstack` for the two pop calls was a drop-in replacement for the full detach flow to work. Any idea what could be going on with the set call? I imagine there's probably some little thing somewhere being tripped up on during the stack iteration that's not triggering the full flow to dispatch. Just guesses here. We're open to chat and get some more details to ya if needed.

Thanks, as always!

EDIT: Fixed description for parent/child calls

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.