-
Notifications
You must be signed in to change notification settings - Fork 83
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
Fast switching between tab bars causing creating new tab instead of restoring previous one #1285
Comments
Can you link a sample we could reproduce this on? A test would be ideal but even just a sample app that we could manually try. Otherwise there's not much for us to go on here |
@ZacSweers sure, here is the repo: |
And here's the video: |
Is this possibly related to #1312? i.e. debouncing issues |
Closing as fixed in 0.21.0 |
Hi @ZacSweers, I believe issue #1285 is not fully resolved. Steps to reproduce:
Observed behavior:
This suggests the Could you please verify this behavior and consider reopening the issue? |
Hi, resetRoot() navigation issues: state loss (v0.25.0) and crashes (v0.26.0) during rapid tab switching (repost from #1930) Testing has revealed two critical issues with resetRoot() across different Circuit versions: Circuit v0.25.0: Circuit v0.26.0:
Steps to reproduce:
|
@diousk thanks for pasting the longer trace. The lack of circuit anywhere in that trace makes me skeptical that this is really a circuit issue vs something in compose's runtime. Sure, it may be getting tickled by circuit in some way, but even if we reproduced the above in a test (which I still think you should try to create), there's no indication we can fix the underlying compose runtime issue. Please file an issue on the compose issue tracker. If they investigate and find that it's actually a circuit issue I'm happy to revisit. |
Someone else filed an issue here: https://issuetracker.google.com/issues/397474792. Will keep an eye on that |
They just changed the status to "Won't Fix (Intended Behaviour)"... |
Can someone who faced this issue share how you are handling it internally? We are currently debouncing resetRoot calls with a 500ms interval, and it really affects overall responsiveness of our app. |
Comment from the issue
We'll look into it. There might be some spots in our |
Fix for #1285 **What happend:** 1. Record A is the backstack 1. Record B replaces Record A as the backstack 1. Record A is in composition until the animated transition to Record B completes 1. Record A replaces Record B as the backstack before the transition completes 1. At this point `NavigableCircuitContent` goes ahead and calls `buildCircuitContentProviders` 1. Since Record B removed Record A from `previousContentProviders` a new `RecordContentProvider` is created 1. `RecordContentProvider` takes into account the `content` lambda in its equality check 1. `AnimatedNavDecoration` then starts to update the transition with the new records 1. The transition now has a new `targetState` and a `currentState` with the same `Screen` and key 1. `AnimatedContent` is composes both of the same state and saveable blows up registering the same key twice So the fix is to remove that lambda from `RecordContentProvider` so the transition can correctly compare the underlying record equality. I reworked how that content was created a bit to also take a state object with all the previously captured values. Just to ensure anything that might have been relying on content changing will still get updated.
Hi,
I found a bug related to navigation. I have an application with bottom nav bar. When i navigate between them using :
navigator.resetRoot(HomeNavTab2, saveState = true, restoreState = true)
everything works fine - the state of each tab is being restored. However, when I rapidly switch between the tabs (akin to "spamming"), the expected state restoration does not occur. Instead, a new screen is generated each time."
The text was updated successfully, but these errors were encountered: