Status Update
Comments
le...@gmail.com <le...@gmail.com> #2
Process: work, PID: 7773
java.util.ConcurrentModificationException
at
androidx.compose.runtime.snapshots.StateListIterator.validateModification(SnapshotStateList.kt:297)
at androidx.compose.runtime.snapshots.StateListIterator.next(SnapshotStateList.kt:276)
at
.DashboardViewModel$getCarousalListApi$1$1$1.invokeSuspend(DashboardViewModel.kt:751)
at
.DashboardViewModel$getCarousalListApi$1$1$1.invoke(Unknown
Source:8)
at
.DashboardViewModel$getCarousalListApi$1$1$1.invoke(Unknown
Source:2)
at
.config.common.ExtensionsKt$launchOnIOWithCompletion$1.invokeSuspend(Extensions.kt:28)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@5443283, Dispatchers.IO]
ja...@veeva.com <ja...@veeva.com> #3
reverse()
constructs two iterators (if the list is > 18 in size), one forward walking and one backwards walking and will modify the array using both iterators. This is currently treated as a concurrent modification as the array was modified after the iterator was created. This is too strict for the Java algorithms. They expect a concurrent modification exception to only be thrown if a structural chagne to the list is made, e.g. an insert or delete, not a value change.
First, mutableStateListOf()
lists will be changed to not interpret setting the value of the slot of an element as a concurrent. Second, they will be changed to support RandomAccess
which avoids the algorithms using the iterators for operations that would be faster if they used get
and set
directly.
ho...@google.com <ho...@google.com>
ko...@gmail.com <ko...@gmail.com> #4
Branch: androidx-main
commit 75f720e1695c3574930d0385211341fac876a834
Author: Chuck Jazdzewski <chuckj@google.com>
Date: Thu Sep 14 15:22:33 2023
Relax concurrent modification exception for snapshot state list
The snapshot state list iterator considered any change made outside the
iterator as a concurrent change. This change relaxes the checking to
only consider structural changes (adding and removing) to be treated as
a concurrent change. This allows SnapshotStateList to be used with
`reverse()` which assumes that setting the value of an element is not a
concurrent change.
Adds RandomeAccess interface to MutableStateList to signal collection
extensions functions they can use direct indexing versions of their
algorithm.
Corrects the set() after a call previous() to update the correct
element.
Fixes: 219554654
Test: ./gradlew :compose:r:r:tDUT
Relnote: """SnapshotStateList is not marked as RandomAccess to enable
the direct indexing version of list helpers to be used"
Change-Id: I5210ca5c0f490619381ecf93ac0b1ccb03071e36
M compose/runtime/runtime/api/current.txt
M compose/runtime/runtime/api/restricted_current.txt
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotStateList.kt
M compose/runtime/runtime/src/nonEmulatorCommonTest/kotlin/androidx/compose/runtime/snapshots/SnapshotStateListTests.kt
os...@google.com <os...@google.com>
cl...@google.com <cl...@google.com> #5
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
Author: Oscar Adame Vázquez <
Link:
Fix Measure/Layout pass handling in ConstraintLayout
Expand for full commit details
Fix Measure/Layout pass handling in ConstraintLayout
ConstraintLayout was not properly handling Measurable/Placeable lifecycle.
As different passes are made with different instances, improper upkeep can result in issues, such as Composables not being placed.
Relnote: N/A
Fixes: 299134793
Test: updated with regression test case
Change-Id: I3831c682b409105274f4bf2e98af303395561c35
Files:
- D
constraintlayout/constraintlayout-compose/api/current.ignore
- D
constraintlayout/constraintlayout-compose/api/restricted_current.ignore
- M
constraintlayout/constraintlayout-compose/api/restricted_current.txt
- M
constraintlayout/constraintlayout-compose/src/androidInstrumentedTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt
- M
constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt
- M
constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/LateMotionLayout.kt
- M
constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionLayout.kt
- M
constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionMeasurer.kt
Hash: c999aaf73e2eba0b893c3fde2546c6d400f77431
Date: Tue Nov 12 13:37:12 2024
jr...@gmail.com <jr...@gmail.com> #7
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
Author: Oscar Adame Vázquez <
Link:
Re-land fix for Measure/Layout pass in ConstraintLayout
Expand for full commit details
Re-land fix for Measure/Layout pass in ConstraintLayout
Similar as I3831c682b409105274f4bf2e98af303395561c35 but without changes to PublishedApi.
ConstraintLayout was not properly handling Measurable/Placeable lifecycle.
As different passes are made with different instances, improper upkeep can result in issues, such as Composables not being placed.
Bug: 299134793
Test: updated with regression test case
Change-Id: Ia3351e13e1ee96bc33f5e6bb5e4f522274ff9c5f
Files:
- M
constraintlayout/constraintlayout-compose/api/restricted_current.txt
- M
constraintlayout/constraintlayout-compose/src/androidInstrumentedTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt
- M
constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt
- M
constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/LateMotionLayout.kt
- A
constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/Measurer.kt
- M
constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionLayout.kt
- M
constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionMeasurer.kt
Hash: 796a51fffa3202f9d206e49a62d6255d645364cb
Date: Tue Jan 21 14:22:31 2025
os...@google.com <os...@google.com> #9
The fix should now be available in :constraintlayout-compose:1.1.1
Description
ConstraintLayout version: constraintlayout-compose:1.1.0-alpha12
Jetpack Compose version: 1.6.0-alpha04
Jetpack Compose component used: ConstraintLayout
Android Studio Build: Android Studio Giraffe | 2022.3.1 Build #AI-223.8836.35.2231.10406996, built on June 29, 2023 Runtime version: 17.0.6+0-17.0.6b829.9-10027231 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Kotlin version: 1.9.10
Material Version: material3:1.2.0-alpha06
This is a regression issue, latest version of
constraintlayout-compose
which worked well:1.1.0-alpha05
Steps to Reproduce or Code Sample to Reproduce:
visibility = if (!detailVisible) Visibility.Gone else Visibility.Visible
)width = Dimension.fillToConstraints
property causes the other ComposeView not to be shown on the screenSample Code
Here you can find a sample project to reproduce it:https://github.com/jarroyoesp/ConstraintLayoutIssue
And this issue just happens in case we use
Visibility.Gone
. If we useVisibility.Invisible
it works well.Temporary Fix
We find a possible fix. If we only set
width
toDimension.fillToConstraints
and in other case we set toDimension.wrapContent
, all the ComposeViews are shown when is their time.