https://kotlinlang.org logo
#compose
Title
# compose
a

Alexander Maryanovsky

11/27/2023, 6:39 AM
I’m investigating an issue where two changes in the computed value of a
derivedState
, one to a new value, and another back to the original one, cause the scope reading the value of the state to be recomposed. <more inside the thread>
In the debugger, I’m lookin at
ComposerImpl.addRecomposeScope
:
Copy code
scope.requiresRecompose = invalidation != null
marks the scope as requiring recomposition. But invalidation.isInvalid() is false (instances contains only that derived state). Shouldn’t
addRecomposeScope
check
invalidation.isInvalid()
before marking the scope as requiring recomposition?
b

Ben Trengrove [G]

11/28/2023, 12:28 AM
I very quickly tried to reproduce this but it worked correctly. Do you have a test case? If you do, I would file a bug
a

Alexander Maryanovsky

11/28/2023, 5:04 AM
Unfortunately I haven’t been able to reproduce it on short examples.