Fixed
Status Update
Comments
je...@google.com <je...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
je...@google.com <je...@google.com>
kl...@google.com <kl...@google.com> #3
kl...@google.com <kl...@google.com>
kl...@google.com <kl...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically ( b/140759491 ).
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
https://android-review.googlesource.com/1288456
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
kl...@google.com <kl...@google.com> #5
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 98f2641f492c7ffc91e77e39d60b77909669f0ea
Author: Zach Klippenstein <klippenstein@google.com>
Date: Wed Nov 09 16:48:00 2022
Send apply notifications after Recomposer finishes frame.
This fixes a bug where updating the intrinsics changes would be delayed
a frame. Changes to the intrinsics measure policy in a
layout node during apply changes was not applied until _after_ the
layout pass, which might result in not invalidating layout that should
have been that frame. And since those changes would only be applied for
the next frame, it would invalidate that frame unnecessarily. In other
words, intrinsics changes would be delayed a frame.
This is a prerequisite for b/222093277 (aosp/2243539).
Test: RemeasureWithIntrinsicsRealClockTest (the current test does not
catch this bug because of b/222093277 ).
Test: RecomposerTests
Relnote: "Snapshot apply notifications are now sent after the
`Recomposer` finishes applying changes."
Change-Id: Iad6c0dcd163a5a8f9c5aec426da3d4f701ca509f
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Recomposer.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/CompositionTests.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/EffectsTests.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/RecomposerTests.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/RemeasureWithIntrinsicsRealClockTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/RemeasureWithIntrinsicsTest.kt
https://android-review.googlesource.com/2296013
Branch: androidx-main
commit 98f2641f492c7ffc91e77e39d60b77909669f0ea
Author: Zach Klippenstein <klippenstein@google.com>
Date: Wed Nov 09 16:48:00 2022
Send apply notifications after Recomposer finishes frame.
This fixes a bug where updating the intrinsics changes would be delayed
a frame. Changes to the intrinsics measure policy in a
layout node during apply changes was not applied until _after_ the
layout pass, which might result in not invalidating layout that should
have been that frame. And since those changes would only be applied for
the next frame, it would invalidate that frame unnecessarily. In other
words, intrinsics changes would be delayed a frame.
This is a prerequisite for
Test: RemeasureWithIntrinsicsRealClockTest (the current test does not
catch this bug because of
Test: RecomposerTests
Relnote: "Snapshot apply notifications are now sent after the
`Recomposer` finishes applying changes."
Change-Id: Iad6c0dcd163a5a8f9c5aec426da3d4f701ca509f
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Recomposer.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/CompositionTests.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/EffectsTests.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/RecomposerTests.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/RemeasureWithIntrinsicsRealClockTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/RemeasureWithIntrinsicsTest.kt
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit f61c557f4526dfa0e33d070de9c262e788184e8a
Author: Zach Klippenstein <klippenstein@google.com>
Date: Thu Oct 20 10:33:11 2022
Defer dispatching coroutines resumed during animation callbacks in UI tests.
This is a workaround for the fact that we use an unconfined dispatcher
in UI tests ( b/254115946 ), which prevents us from being able to perform
layout passes for frames in some cases ( b/222093277 ).
TestMonotonicFrameClock gets a continuation interceptor which wraps continuations with
behavior that will usually no-op, but if the continuation is resumed
while frame callbacks are running, it will defer resuming the
underlying continuation until all the frame callbacks have finished.
This matches how continuations are dispatched in non-test code, since
that code does not use an unconfined dispatcher.
In order to preserve test delay skipping, the interceptor implements
Delay and delegates it to the underlying dispatcher, just like
ApplyingContinuationInterceptor is already doing.
This CL also adds a callback that runs after each frame in
TestMonotonicFrameClock. This change was originally in aosp/2121435.
This allows us to perform measure and layout after each frame if
necessary, which aligns the measure/layout timing with production.
Bug: b/254115946
Bug: b/222093277
Bug: b/255802670
Test: PhaseOrderingTest, TestMonotonicFrameClockTest
Relnote: "In UI tests using a Compose rule, continuations resumed during
`withFrameNanos` callbacks will not be dispatched until after all
frame callbacks have finished running. This matches the behavior of
compose when running normally. However, tests that rely on the old
behavior may fail. This should only affect code that calls
`withFrameNanos` or `withFrameMillis` directly, and has logic
outside of callback passed to those functions that may need to be
moved inside the callbacks. See the animation test changes in this
CL for examples."
Relnote: "Added optional `onPerformTraversals: (Long) -> Unit` parameter to
`TestMonotonicFrameClock` constructor and factory function to run
code after `withFrameNanos` callbacks but before resuming callers'
coroutines."
Change-Id: Idb41309445a030c91e8e4ae05daa9642b450505c
M compose/animation/animation-core/src/androidAndroidTest/kotlin/androidx/compose/animation/core/SingleValueAnimationTest.kt
M compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimatedContentTest.kt
M compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/CrossfadeTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableFocusableInteractionTest.kt
M compose/test-utils/src/androidMain/kotlin/androidx/compose/testutils/AndroidComposeTestCaseRunner.android.kt
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/ComposeUiTest.android.kt
M compose/ui/ui-test-junit4/src/commonMain/kotlin/androidx/compose/ui/test/ApplyingContinuationInterceptor.kt
M compose/ui/ui-test/api/public_plus_experimental_current.txt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/PhaseOrderingTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/TestMonotonicFrameClockTest.kt
A compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/internal/DelayPropagatingContinuationInterceptorWrapper.kt
A compose/ui/ui-test/src/jvmMain/kotlin/androidx/compose/ui/test/FrameDeferringContinuationInterceptor.kt
M compose/ui/ui-test/src/jvmMain/kotlin/androidx/compose/ui/test/TestMonotonicFrameClock.jvm.kt
https://android-review.googlesource.com/2260389
Branch: androidx-main
commit f61c557f4526dfa0e33d070de9c262e788184e8a
Author: Zach Klippenstein <klippenstein@google.com>
Date: Thu Oct 20 10:33:11 2022
Defer dispatching coroutines resumed during animation callbacks in UI tests.
This is a workaround for the fact that we use an unconfined dispatcher
in UI tests (
layout passes for frames in some cases (
TestMonotonicFrameClock gets a continuation interceptor which wraps continuations with
behavior that will usually no-op, but if the continuation is resumed
while frame callbacks are running, it will defer resuming the
underlying continuation until all the frame callbacks have finished.
This matches how continuations are dispatched in non-test code, since
that code does not use an unconfined dispatcher.
In order to preserve test delay skipping, the interceptor implements
Delay and delegates it to the underlying dispatcher, just like
ApplyingContinuationInterceptor is already doing.
This CL also adds a callback that runs after each frame in
TestMonotonicFrameClock. This change was originally in aosp/2121435.
This allows us to perform measure and layout after each frame if
necessary, which aligns the measure/layout timing with production.
Bug:
Bug:
Bug:
Test: PhaseOrderingTest, TestMonotonicFrameClockTest
Relnote: "In UI tests using a Compose rule, continuations resumed during
`withFrameNanos` callbacks will not be dispatched until after all
frame callbacks have finished running. This matches the behavior of
compose when running normally. However, tests that rely on the old
behavior may fail. This should only affect code that calls
`withFrameNanos` or `withFrameMillis` directly, and has logic
outside of callback passed to those functions that may need to be
moved inside the callbacks. See the animation test changes in this
CL for examples."
Relnote: "Added optional `onPerformTraversals: (Long) -> Unit` parameter to
`TestMonotonicFrameClock` constructor and factory function to run
code after `withFrameNanos` callbacks but before resuming callers'
coroutines."
Change-Id: Idb41309445a030c91e8e4ae05daa9642b450505c
M compose/animation/animation-core/src/androidAndroidTest/kotlin/androidx/compose/animation/core/SingleValueAnimationTest.kt
M compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/AnimatedContentTest.kt
M compose/animation/animation/src/androidAndroidTest/kotlin/androidx/compose/animation/CrossfadeTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableFocusableInteractionTest.kt
M compose/test-utils/src/androidMain/kotlin/androidx/compose/testutils/AndroidComposeTestCaseRunner.android.kt
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/ComposeUiTest.android.kt
M compose/ui/ui-test-junit4/src/commonMain/kotlin/androidx/compose/ui/test/ApplyingContinuationInterceptor.kt
M compose/ui/ui-test/api/public_plus_experimental_current.txt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/PhaseOrderingTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/TestMonotonicFrameClockTest.kt
A compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/internal/DelayPropagatingContinuationInterceptorWrapper.kt
A compose/ui/ui-test/src/jvmMain/kotlin/androidx/compose/ui/test/FrameDeferringContinuationInterceptor.kt
M compose/ui/ui-test/src/jvmMain/kotlin/androidx/compose/ui/test/TestMonotonicFrameClock.jvm.kt
kl...@google.com <kl...@google.com> #8
Since this bug is in the test runtime, you might expect that fixing it would expose actual bugs that tests weren't catching, because they weren't able to. And it did!
- Coroutine continuations were being dispatched immediately even during frame callbacks (
,b/254115946 , aosp/2260389). This was a bug in the test runtime itself, but it's a bug that even external Compose tests would hit so it's still a production bug in a sense.b/255802670 - Intrinsics were writing a state object in applyChanges that was not getting picked up until the next frame, this was a bug in
Recomposer
(aosp/2296013). - The
ConstraintLayout
composable was triggering an additional, unnecessary recomposition whenever a helper changed ( , aosp/2319364).b/261270254
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
commit 9f9434a17870acd76c6c692dab9ffa425d1eab04
Author: Zach Klippenstein <klippenstein@google.com>
Date: Sat Dec 03 08:00:35 2022
Fix ConstraintLayout causing extra recomposition when helper changes.
Fixes: b/261270254
Bug: b/222093277
Test: ConstraintLayoutTest
Relnote: "Fixed issue where ConstraintLayout always triggered an
unnecessary extra recomposition when helpers were changed."
Change-Id: Id83ada3e963b20180c324f25b6db7c53f810463f
M constraintlayout/constraintlayout-compose/src/androidAndroidTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt
M constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt
https://android-review.googlesource.com/2319364
Branch: androidx-main
commit 9f9434a17870acd76c6c692dab9ffa425d1eab04
Author: Zach Klippenstein <klippenstein@google.com>
Date: Sat Dec 03 08:00:35 2022
Fix ConstraintLayout causing extra recomposition when helper changes.
Fixes:
Bug:
Test: ConstraintLayoutTest
Relnote: "Fixed issue where ConstraintLayout always triggered an
unnecessary extra recomposition when helpers were changed."
Change-Id: Id83ada3e963b20180c324f25b6db7c53f810463f
M constraintlayout/constraintlayout-compose/src/androidAndroidTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt
M constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-main
commit 0253b7d395277c6a4669cbcb1ff7bdc5583cb6c6
Author: Zach Klippenstein <klippenstein@google.com>
Date: Tue Nov 22 14:33:04 2022
Make UI tests run layout passes between frames
Checks if a local measure/layout is scheduled after execution of each
frame. With a local measure/layout I mean a layout pass for which an
Android View layout pass has not been scheduled. It is local because it
only affects composables, and not any View outside the host View.
Fixes: b/222093277
Bug: b/219885899
Test: AnimatedVisibilityTest (new in ui-test-junit4)
Test: PhaseOrderingTest
Test: TestRuleExecutesLayoutPassesWhenWaitingForIdleTest
Test: BasicCurvedTextTest
Test: this change is also exercised by nearly all tests
Relnote: "Android Compose UI tests will now run layout passes for each frame when
executing frames to get to idle (e.g. via `waitForIdle`). This may
affect tests that assert on individual frames of layout animations."
Change-Id: I8ea08728a395665f9ec7965579797e537b2c35e5
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BackdropScaffoldTest.kt
M compose/ui/ui-test-junit4/build.gradle
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/ComposeUiTest.android.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/PhaseOrderingTest.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/TestRuleExecutesLayoutPassesWhenWaitingForIdleTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/RootForTest.kt
M wear/compose/compose-foundation/src/androidAndroidTest/kotlin/androidx/wear/compose/foundation/BasicCurvedTextTest.kt
https://android-review.googlesource.com/2243539
Branch: androidx-main
commit 0253b7d395277c6a4669cbcb1ff7bdc5583cb6c6
Author: Zach Klippenstein <klippenstein@google.com>
Date: Tue Nov 22 14:33:04 2022
Make UI tests run layout passes between frames
Checks if a local measure/layout is scheduled after execution of each
frame. With a local measure/layout I mean a layout pass for which an
Android View layout pass has not been scheduled. It is local because it
only affects composables, and not any View outside the host View.
Fixes:
Bug:
Test: AnimatedVisibilityTest (new in ui-test-junit4)
Test: PhaseOrderingTest
Test: TestRuleExecutesLayoutPassesWhenWaitingForIdleTest
Test: BasicCurvedTextTest
Test: this change is also exercised by nearly all tests
Relnote: "Android Compose UI tests will now run layout passes for each frame when
executing frames to get to idle (e.g. via `waitForIdle`). This may
affect tests that assert on individual frames of layout animations."
Change-Id: I8ea08728a395665f9ec7965579797e537b2c35e5
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BackdropScaffoldTest.kt
M compose/ui/ui-test-junit4/build.gradle
M compose/ui/ui-test-junit4/src/androidMain/kotlin/androidx/compose/ui/test/ComposeUiTest.android.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/PhaseOrderingTest.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/TestRuleExecutesLayoutPassesWhenWaitingForIdleTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/RootForTest.kt
M wear/compose/compose-foundation/src/androidAndroidTest/kotlin/androidx/wear/compose/foundation/BasicCurvedTextTest.kt
ju...@google.com <ju...@google.com> #11
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.animation:animation:1.4.0-alpha03
androidx.compose.animation:animation-core:1.4.0-alpha03
androidx.compose.foundation:foundation:1.4.0-alpha03
androidx.compose.runtime:runtime:1.4.0-alpha03
androidx.compose.ui:ui:1.4.0-alpha03
androidx.compose.ui:ui-test:1.4.0-alpha03
androidx.compose.ui:ui-test-junit4:1.4.0-alpha03
na...@google.com <na...@google.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material:material:1.4.0-alpha04
androidx.compose.ui:ui:1.4.0-alpha04
androidx.compose.ui:ui-test:1.4.0-alpha04
androidx.compose.ui:ui-test-junit4:1.4.0-alpha04
androidx.wear.compose:compose-foundation:1.2.0-alpha02
pr...@google.com <pr...@google.com> #13
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha06
Description
When we're awaiting idleness, we forward ("pump") the clock to reach quiescence faster. But in many cases we also have to wait for measure/layout, which is still driven by the Choreographer. If we can perform a measure/layout pass ourselves when we detect that's the thing we're waiting for, we can potentially reach idleness faster.