Fixed
Status Update
Comments
il...@google.com <il...@google.com>
yr...@google.com <yr...@google.com> #2
Yigit, do you have time to fix it?
reemission of the same liveData is racy
reemission of the same liveData is racy
ap...@google.com <ap...@google.com> #3
yea i'll take it.
il...@google.com <il...@google.com> #4
Thanks for the detailed analysis. This may not be an issue anymore since we've started using Main.immediate there but I' not sure; I'll try to create a test case.
na...@google.com <na...@google.com> #5
just emitting same live data reproduces the issue.
@Test
fun raceTest() {
val subLiveData = MutableLiveData(1)
val subject = liveData(testScope.coroutineContext) {
emitSource(subLiveData)
emitSource(subLiveData) //crashes
}
subject.addObserver().apply {
testScope.advanceUntilIdle()
}
}
@Test
fun raceTest() {
val subLiveData = MutableLiveData(1)
val subject = liveData(testScope.coroutineContext) {
emitSource(subLiveData)
emitSource(subLiveData) //crashes
}
subject.addObserver().apply {
testScope.advanceUntilIdle()
}
}
al...@gmail.com <al...@gmail.com> #6
Comment has been deleted.
fv...@gmail.com <fv...@gmail.com> #7
Comment has been deleted.
fv...@gmail.com <fv...@gmail.com> #8
Comment has been deleted.
fv...@gmail.com <fv...@gmail.com> #9
Comment has been deleted.
ar...@gmail.com <ar...@gmail.com> #10
I didn't approve of any of this on my device can you please remove
al...@gmail.com <al...@gmail.com> #12
J
al...@gmail.com <al...@gmail.com> #13
J
al...@gmail.com <al...@gmail.com> #14
G
al...@gmail.com <al...@gmail.com> #15
H
al...@gmail.com <al...@gmail.com> #16
H
al...@gmail.com <al...@gmail.com> #17
U
al...@gmail.com <al...@gmail.com> #18
Y
al...@gmail.com <al...@gmail.com> #19
Y
al...@gmail.com <al...@gmail.com> #20
6j
al...@gmail.com <al...@gmail.com> #21
Y
Description
Component used: Activity
Version used: 1.6.0
Devices/Android versions reproduced on: Samsung Galaxy S20+ Android 12 (with August 2022 Google Play system update, photo picker is confirmed working)
For
ActivityResultContracts.PickMultipleVisualMedia
, you useInteger.MAX_VALUE
as an overload for the maximum number of items the photo picker is able to select for versions Android 12 and below (asMediaStore.getPickImagesMaxLimit()
is only available forTIRAMISU
and above).However, using this value causes the photo picker to not be able to start/be launched.
I tried changing the
maxItems
value to another value (I tried 100) and the photo picker started to work.