hotwired / turbo-android

Android framework for making Turbo native apps
MIT License
423 stars 51 forks source link

Fix app breaking on cold boot redirects #220

Closed ghiculescu closed 2 years ago

ghiculescu commented 2 years ago

Fixes https://github.com/hotwired/turbo-android/issues/217

The 500ms delay logic in shouldOverrideUrlLoading / shouldProposeThrottledVisit is fine for link clicks, but doesn't make sense when following multiple redirects. So this PR just skips that logic while in a cold boot redirect.

See https://github.com/hotwired/turbo-android/issues/217 for more detail on example scenarios and how to replicate. There's another branch (here) that you can use to replicate, but I figured I'd keep the fix PR small and if you'd like the extra examples added to the demo I can make followup PRs for that.

jayohms commented 2 years ago

Thank you @ghiculescu! Great work uncovering this subtle bug — and your solution makes sense. Merging now.