Fixed
Status Update
Comments
wk...@google.com <wk...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 4945dfa31180f343697de5810b99ec80a48dc386
Author: Andrei Shikov <ashikov@google.com>
Date: Mon Jun 20 16:09:06 2022
Prevent removing derived state from composition when it is read in other scopes
Derived state observations were previously unconditionally removed from the recompose scope and composition together, which broke other scopes which might be still observing derived state.
This change only removes derived state instances if it is no longer observed by other scopes.
Fixes: 236618362
Test: CompositionAndDerivedStateTests#observingDerivedStateInMultipleScopes
Change-Id: I92e7c8702efecb33bea3ea3effe9ec47e2a6ae5b
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Composition.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/CompositionAndDerivedStateTests.kt
https://android-review.googlesource.com/2131915
Branch: androidx-main
commit 4945dfa31180f343697de5810b99ec80a48dc386
Author: Andrei Shikov <ashikov@google.com>
Date: Mon Jun 20 16:09:06 2022
Prevent removing derived state from composition when it is read in other scopes
Derived state observations were previously unconditionally removed from the recompose scope and composition together, which broke other scopes which might be still observing derived state.
This change only removes derived state instances if it is no longer observed by other scopes.
Fixes: 236618362
Test: CompositionAndDerivedStateTests#observingDerivedStateInMultipleScopes
Change-Id: I92e7c8702efecb33bea3ea3effe9ec47e2a6ae5b
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Composition.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/CompositionAndDerivedStateTests.kt
il...@google.com <il...@google.com> #3
The following release(s) address this bug:
androidx.compose.runtime:runtime:1.3.0
Description
Navigation Arch component and Safe Args Plugin versions 1.0.0-alpha02, 1.0.0-alpha04
Device: Samsung Galaxy S6
I have an argument for activity or fragment when using Navigation Arch component
<argument
android:name="EXTRA_INTEGER"
app:argType="reference"
android:defaultValue="@integer/integer_value"/>
where @integer/integer_value is: <item name="integer_value" format="integer" type="integer">-1</item>
When it navigates with code:
NavHostFragment.findNavController(this).navigate(R.id.action_openFragment)
the value of arguments or intent extra becomes equal -1 (arguments.getInt("EXTRA_INTEGER") or intent.getIntExtra("EXTRA_INTEGER"))
When I use Safe Args plugin generated class
NavHostFragment.findNavController(this).navigate(MyFragmentDirections.actionOpenFragment())
it turns out to be equal reference itself (e.g. 2131296267)
It is an inconsistent behavior and should be fixed in one or another way