google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.31k stars 592 forks source link

[navigation-material] Fixes crash in BottomSheetNavigator when user goes back #1753

Closed LluisFelip closed 4 months ago

LluisFelip commented 4 months ago

Attempting to address https://github.com/google/accompanist/issues/1750 and https://github.com/google/accompanist/issues/1733.

Although I couldn't reproduce the NullPointerException on BottomSheetNavigator.kt:191, by looking at the code I suggest avoiding the not-null assertion operator on retainedEntry with a let scope function.

jossiwolf commented 4 months ago

Thanks for the PR! We will need a test for this, for which we might need steps to repro. Please let us know if you find any and are able to add a test!

LluisFelip commented 4 months ago

Unfortunately I couldn't find any way of reproducing nor testing it, since it seems to be some sort of race-condition with that retainedEntry val inside that sheetContent Composable function 😞

We're going to try it with real users by replacing this module with the fixed version of it with real users, so we'll be able to assess if it fixes the issue.

Any idea/suggestion on how to test this?

ianhanniballake commented 4 months ago

With the release of Compose Material 1.7.0-alpha04, the Material team has added a new artifact: androidx.compose.material:material-navigation, which fully replaces Accompanist Navigation Material.

As such, we are closing all PRs here on Accompanist.