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

Navigation actions dispatched twice #70

@fonesti

Description

@fonesti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions