-
Notifications
You must be signed in to change notification settings - Fork 73
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
rememberRetained
retains value of removed node
#1783
Comments
I found and attached more test case in above link that |
I have been looking at implementation of
In the case of On the other hand, However, when This behavior makes |
Hi, we'll take a look when we have time. Some feedback though - a lot of this has read like a list of complaints and then demands, I would encourage you to be a little more constructive and seeking to learn (perhaps using discussions to ask questions about the areas you are unsure about). |
@ZacSweers The reason my original message might have sounded critical is that I encountered this issue during the final stages of releasing a product that uses Circuit. After coding and analyzing the problem for over 20 hours, I was likely more sensitive than usual when writing the comment. If it caused any frustration, I hope you can kindly understand. Regarding the issue, I don't have a deep enough understanding of the internal implementation of rememberRetained to make changes myself, so I initially reported it as a bug. However, I will review it further over the weekend to see if I can propose a possible solution. Thank you for your understanding. |
@ZacSweers I’ll add some more organized test cases and submit this as a PR 🙂 |
Sounds good! |
When calling a nested circuit
screenB
conditionally withinscreenA
under the hierarchy of NavigableCircuitContent,as in the following case:
The
rememberRetained
called in the presenter of the nested circuitscreenB
retains its previous value even afterscreenB
is removed and re-added. This behavior contrasts withrememberRetained
called from thescreenB
's UI, which is reinitialized, suggesting this is a bug.This issue only occurs when the
presentWithLifecycle
feature is set to true.I have written a test code to reproduce this bug. Could you please take a look at it?
https://github.com/vulpeszerda/circuit/blob/navigable-circuit-content-test/circuit-foundation/src/jvmTest/kotlin/com/slack/circuit/foundation/NavigableCircuitContentRetainTest.kt
This bug only occurs when screenB is equal to the previously added screen instance.
The text was updated successfully, but these errors were encountered: