Decompose-Router icon indicating copy to clipboard operation
Decompose-Router copied to clipboard

Router in backstack loses its state after second configuration change

Open Skeptick opened this issue 1 year ago • 3 comments

Let's assume we have following hierarchy:

├── RootStackRouter
│   ├── Screen with ChildStackRouter
│       ├── Screen
│       ├── Screen

Then we open the screen onRootStackRouter, on top of the screen with ChildStackRouter:

├── RootRouter
│   ├── Screen with ChildRouter
│       ├── Screen
│       ├── Screen
│   │── Screen

And we trigger Android activity recreation twice (!) by changing the configuration (for example, switching to Dark theme and back to Light theme).

In this case, when returning to the screen with ChildStackRouter, we will see that it has lost its stack.

Skeptick avatar Oct 20 '24 21:10 Skeptick

Most likely the issue can be fixed at StateKeeperDispatcher level. I will need to try and test this.

image

arkivanov avatar Oct 20 '24 23:10 arkivanov

I confirm that the problem is fixed with Decompose 3.2.0

Skeptick avatar Oct 23 '24 12:10 Skeptick

Will work on bumping to new decompose soon. Stay tuned 👍

xxfast avatar Oct 29 '24 05:10 xxfast