Fixed
Status Update
Comments
il...@google.com <il...@google.com>
fo...@google.com <fo...@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
fo...@google.com <fo...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@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.
cl...@google.com <cl...@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()
}
}
na...@google.com <na...@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: Compose Navigation Version used: 2.5.1 Devices/Android versions reproduced on:
Issue Description
I added Deeplink support for json files to one of my Compose Screens like this
After opening a json file the app navigates to the correct screen, but when the user clicks on the toolbar back button and navigateUp is triggered the app crashes instantly with following stacktrace:
After adding a default argument to the nav composable the app doesn't crash, but it feels like a dirty workaround because the argument is never actively used.
Is it possible to read the file uri from an argument? if yes, how does the deeplink and the argument need to be declared?
Sample Project:https://github.com/TobyEb/NavigationFileDeeplink