Fixed
Status Update
Comments
so...@google.com <so...@google.com>
ch...@google.com <ch...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
ch...@google.com <ch...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
ch...@google.com <ch...@google.com>
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 803f067eb6fbc77ca403f71fd65e32b96d3630d4
Author: Adam Powell <adamp@google.com>
Date: Fri Aug 28 12:32:58 2020
launchInComposition now launches dispatched
launchInComposition no longer launches as an undispatched coroutine. The
initial rationale for this behavior was to allow for subscriptions that
synchronously emit a first value or any other work that happens before
first suspension to have their results reflected more quickly, but this
produces inconsistent results for the frame, where composition and
layout/draw may see different values.
Remove the undispatched launch and let the coroutine launch proceed
normally.
Fixes: 166486000
Test: SuspendingEffectsTests.kt
Relnote: "launchInComposition no longer launches coroutines undispatched"
Change-Id: Ief6afbbd9cae98ef337808a5cb481f012df602c8
M compose/runtime/runtime/src/androidAndroidTest/kotlin/androidx/compose/runtime/SuspendingEffectsTests.kt
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Recomposer.kt
https://android-review.googlesource.com/1414949
Branch: androidx-master-dev
commit 803f067eb6fbc77ca403f71fd65e32b96d3630d4
Author: Adam Powell <adamp@google.com>
Date: Fri Aug 28 12:32:58 2020
launchInComposition now launches dispatched
launchInComposition no longer launches as an undispatched coroutine. The
initial rationale for this behavior was to allow for subscriptions that
synchronously emit a first value or any other work that happens before
first suspension to have their results reflected more quickly, but this
produces inconsistent results for the frame, where composition and
layout/draw may see different values.
Remove the undispatched launch and let the coroutine launch proceed
normally.
Fixes: 166486000
Test: SuspendingEffectsTests.kt
Relnote: "launchInComposition no longer launches coroutines undispatched"
Change-Id: Ief6afbbd9cae98ef337808a5cb481f012df602c8
M compose/runtime/runtime/src/androidAndroidTest/kotlin/androidx/compose/runtime/SuspendingEffectsTests.kt
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Recomposer.kt
Description
Compose options:
Updating a MutableState value in the backgroung, sometimes I get the following error:
Code to reproduce is attached. See
@Composable TestSnapshotCrash()
It's a simple layout with 3 Tabs and a LazyColumn. Changing the tab, a new list is created in the background and assigned to a mutablestate. That state is used in the lazycolumn. If you change the tab very quickly and many times, the crash should happen.