Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goBack() doesn't work well with pending transactions. #219

Closed
lassem opened this issue Dec 29, 2016 · 2 comments
Closed

goBack() doesn't work well with pending transactions. #219

lassem opened this issue Dec 29, 2016 · 2 comments

Comments

@lassem
Copy link

lassem commented Dec 29, 2016

The old version of the library used move to go back in history, while as 1.0 alpha uses a synchronous call to setHistory.

This doesn't work well in our case and I'm suggesting it is wrong behavior.

What happens in our case:

  1. Key 1 is on the backstack
  2. Key 1 pushes Key 2, Key 3 and Key 4 to the backstack, traversal begins.
  3. Key 4 decides that the work it was supposed to do was not needed. Calls goBack
    • Calling goBack from here does not work as expected as Key 2, Key 3 and Key4 are not yet in the history.
  4. After the call to goBack from Key 4 we're at Key 1; not Key 3 as expected.
@Zhuinden
Copy link

Zhuinden commented Jan 4, 2017

Key 4 decides that the work it was supposed to do was not needed.

Traversals are not cancelable. It says so on the interface declaration.

So if setHistory(}K1,K2,K3,K4}) is called, then callback.onTraversalComplete() finishes, then goBack() will go to K1,K2,K3 which means the top is K3.

@lassem
Copy link
Author

lassem commented Jan 25, 2017

Okay. I'm closing this then.

The current workaround is to do a Handler.post()

@lassem lassem closed this as completed Jan 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants