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

Navigation actions dispatched twice #70

Open
fonesti opened this issue Oct 18, 2019 · 0 comments
Open

Navigation actions dispatched twice #70

fonesti opened this issue Oct 18, 2019 · 0 comments

Comments

@fonesti
Copy link
Contributor

fonesti commented Oct 18, 2019

Imagine a common scenario, where a navigation action is dispatched on a button tap.

@objc func didTapProfile() {
  self.dispatch(Show(Screen.profile), animated: true)
}

The flow will leave the main thread, without performing the actual navigation (that will be performed later, coming back to the main thread).
Note that there are no timing guarantees here.
Very rarely, it happens that the user is able to tap the button twice.
The duplicated navigation request is often unexpected and unhandled, leading to a crash.
This can be simulated adding an artificial delay (NSThread.sleep(0.5)) in the navigation action.

┆Issue is synchronized with this Asana task by Unito

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

1 participant