Fixed
Status Update
Comments
il...@google.com <il...@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
al...@mercari.com <al...@mercari.com> #3
yea i'll take it.
al...@mercari.com <al...@mercari.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.
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@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()
}
}
jb...@google.com <jb...@google.com> #6
With 2.2.0-alpha04 (that use Main.immediate), the issue seems to be still there (I tested it by calling emitSource() twice, like your test case)
Description
Component used: Navigation Version used: 2.4.0-beta02
Query parameters are being decoded twice,
The first one viahttps://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt;l=181
Uri.getQueryParameter
call in:and for the second time in :https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt;l=193
This results to wrong incorrect final decoded value provided to the
SavedStateHandle
.This leads to encoded special characters such as
%
to be decoded incorrectly. For example, the raw value being%555
gets encoded correctly to%25555
, Then on the first decode it gets correctly decoded back into%555
, but due to decoding an already decoded string, the final decoded argument value becomesU5
.It is easily replicable with common use case. For example, for routes with search query like
search?query=%555
, the argument transforms intoU5
and is searched instead.