wealthfront / magellan

The simplest navigation library for Android.
Apache License 2.0
677 stars 71 forks source link

Conditionally restore backstack to undo unwanted operations #238

Closed cmathew closed 2 years ago

cmathew commented 2 years ago

meanwhile if it's an operation we want, then just continue as normal.

The problem of the existing "dry run" approach is that it potentially runs all backstack operations twice - once for the "dry run", and again "for real". This causes problems if you have non-idempotent state changes inside a backstack operation (example: manipulating the intent on an Activity during deeplinking logic).

With this approach, we're guaranteed to only run each backstack operation once.