Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant