Status Update
Comments
yo...@gmail.com <yo...@gmail.com> #2
Does the program work without the compiler switch. That is, is `"-P", "plugin:androidx.compose.compiler.plugins.kotlin:experimentalStrongSkipping=true",` required to reproduce or is just changing the runtime enough?
as...@google.com <as...@google.com>
as...@google.com <as...@google.com> #3
Sorry for that, I will try to extract an example when I'm free.
as...@google.com <as...@google.com> #4
I have find a sample code to reproduce that
setContent {
val dialogState = remember { DialogState() }
dialogState.Intercept()
LaunchedEffect(Unit) {
delay(1000)
dialogState.bgWork {
delay(5000)
}
dialogState.showSelectActions {
onSelect("a") {
}
onSelect("b") {
}
}
}
}
You can find implementation of DialogState
here
ap...@google.com <ap...@google.com> #5
Let me sort it out
The first crash
Reproduce: navigate to a gallery and navigate back
The reason is we have some code assume the forget order of RememberObserver(DisposableEffect), and 52835066c9044647a65dfb566f03131aab46e793
changed the order. Seems this is a intended behaviour.
I will fix it from my side. My bad
The second crash
Reproduce: #4 comment
StackTrace:
We got a wrong object from SlotTable during recompose
na...@google.com <na...@google.com> #6
And interestingly, if we insert delay(1000) between two dialog suspend usage
dialogState.bgWork {
delay(5000)
}
delay(1000)
dialogState.showSelectActions {
onSelect("a") {
}
onSelect("b") {
}
}
It will not crash
Description
Jetpack Compose version: bom
2023.10.01
Jetpack Compose component(s) used:
remember
Kotlin version:
1.9.22
compose compiler:
1.5.8
The way
remember
treats Java method refs as keys differs with Intrinsic remember.The
Slider
in the code below DOES work if intrinsicremember
is disabled. but you can NOT slide theSlider
if intrinsicremember
is enabled (which is the default in 1.5.8)The
Slider
also works with kotlin 1.9.20 and 1.5.5 (before intrinsicremember
was enabled by default) .Also, note that if you use a Kotlin class instead of a Java class here then the Slider works fine with intrinsic
remember
enabled.The problem seems to be that
remember
thinks the methodRef key is changing on every recomposition when intrinsicremember
is enabled .This is a minimal reproducer.
Note: here is the config to disable
intrinsicRemember