Fixed
Status Update
Comments
ch...@google.com <ch...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Chuck Jazdzewski <
Link:
Change the snapshot id to be snapshotId: SnapshotId
Expand for full commit details
Change the snapshot id to be snapshotId: SnapshotId
The snapshot `id` can overflow in some extreme situations. The type
changed to be a `SnapshotId`, which is an expect/actual type that
is `Long` in the JVM. Using expect/actual allows the type to be a
more appropriate type for other platforms that don't have a native
`Long` type. Using a `Long` on the JVM will will ensure it doesn't
overflow in any reasonable timeframe.
Fixes: 374821679
Test: existing tests, ./gradlew :compose:r:r:test
Relnote: """Added `snapshotId`, of type `Long`, to `Snapshot` and
derecated `id`.
The ID of a snapshot changed from a `Int` to a `Long` to avoid the
snapshot ID from overflowing on systems with very high frame rates
and long running animations.
The type was made expect/actual to allow this type to be `Int`,
or other type, on platforms that don't have a native `Long` type.
Platforms that do not have a native `Long`, such as JavaScript,
should avoid high frame rates (over 1000 FPS) which would cause
an overflow for `Int` approximate every 24 days.
"""
Change-Id: I38ac3d43d3af7f691c957017eaf6895f5ae6ebb9
Files:
- M
compose/runtime/runtime/api/current.txt
- M
compose/runtime/runtime/api/restricted_current.txt
- M
compose/runtime/runtime/integration-tests/src/androidInstrumentedTest/kotlin/androidx/compose/runtime/RecomposerTests.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Composer.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/DerivedState.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SnapshotDoubleState.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SnapshotFloatState.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SnapshotIntState.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SnapshotLongState.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SnapshotState.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/Snapshot.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotDoubleIndexHeap.kt
- A
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotId.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotIdSet.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotStateList.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotStateMap.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotStateObserver.kt
- M
compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/SnapshotStateSet.kt
- A
compose/runtime/runtime/src/jvmMain/kotlin/androidx/compose/runtime/snapshots/SnapshotId.jvm.kt
- A
compose/runtime/runtime/src/linuxx64StubsMain/kotlin/androidx/compose/runtime/snapshots/SnapshotId.linuxx64Stubs.kt
- M
compose/runtime/runtime/src/nonEmulatorCommonTest/kotlin/androidx/compose/runtime/snapshots/SnapshotDoubleIndexHeapTests.kt
- M
compose/runtime/runtime/src/nonEmulatorCommonTest/kotlin/androidx/compose/runtime/snapshots/SnapshotIdSetTests.kt
- M
compose/runtime/runtime/src/nonEmulatorCommonTest/kotlin/androidx/compose/runtime/snapshots/SnapshotTests.kt
Hash: 6c1a600b094f14c611643225a0f1be54a7a9fd56
Date: Mon Oct 21 16:38:33 2024
na...@google.com <na...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.runtime:runtime:1.8.0-alpha06
androidx.compose.runtime:runtime-android:1.8.0-alpha06
androidx.compose.runtime:runtime-jvmstubs:1.8.0-alpha06
androidx.compose.runtime:runtime-linuxx64stubs:1.8.0-alpha06
Description
Bug b/370536104 demonstrates a scenario where the
Int
Snapshot Id can can overflow. The snapshot Id should be replaced with aLong
to prevent it overflowing before the computer decomposes.