Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null check in TurboNavRule fails #329

Open
jhutarek opened this issue Apr 8, 2024 · 5 comments · May be fixed by #333
Open

Null check in TurboNavRule fails #329

jhutarek opened this issue Apr 8, 2024 · 5 comments · May be fixed by #333

Comments

@jhutarek
Copy link
Contributor

jhutarek commented Apr 8, 2024

This null check for NavController#currentBackStackEntry sometimes fails. Looks like a timing problem with deep links (we might try to navigate before the fragment lifecycle is ready).

@scuml
Copy link

scuml commented May 8, 2024

I've had a problem with that with the app I am currently writing. I trigger it by opening a modal, dismissing it, and then any other link click fails.

Crash.mp4

The root cause for my issue is here -- commenting this out removes the crash.

https://github.com/hotwired/turbo-android/blob/main/turbo/src/main/kotlin/dev/hotwire/turbo/nav/TurboNavigator.kt#L150

It looks like the navigator is removing the initial stack entry when the modal is opened. So the history stack becomes empty on dismiss.

@scuml scuml linked a pull request May 8, 2024 that will close this issue
@diegocharles
Copy link

I'm having this issue as well.

video.mov

@diegocharles
Copy link

Hi @scuml @jhutarek As my experience with Android development is limited, would guys have any advice for me in order to overpassing this error until the pr is not approved?
With Rails I would monkey-patch the class or point the gem to the branch which fixes the pr, but I'm not sure what to do here. Can you help me please?

@scuml
Copy link

scuml commented May 9, 2024

I'm a bit new as well. I ended up removing the Turbo dependency from gradle.kts, and manually adding the source into my project file - this took some time as I needed to correct namespaces and merge the res directories.

@jhutarek I'd love to know if there is a simpler way. Any pointers to override/monkey patch would be greatly appreciated.

@diegocharles
Copy link

Thanks @scuml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants