Ensure that a snapshot is cached before navigating to a new location#303
Ensure that a snapshot is cached before navigating to a new location#303
Conversation
|
Looks great! In the hotwired/turbo-ios#181 I added a delegate method to deactivate the Visitable when the VisitableView did disappear; the thought was that we could end up with an active, but orphaned Visitable for the session, eg. when a modal is dismissed, it's WebView would still stay active, potentially receiving Turbo Streams etc. in the background, which feels off. We'd rather prepare the screenshot until next visit in that session. Is there a similar need for such a thing in the Android library? TBH I'm not that familiar with the Turbo Android implementation, as we've primarily re-implemented most of it in the React Native Turbo library due to TurboSession marked as private. |
|
There shouldn't be any similar concerns in the Android library, since the |
This is the Android counterpart to: hotwired/turbo-ios#181
Prior to this PR it was possible that a snapshot was not cached for a given page when navigating away from a
WebViewscreen. Replication steps:ABBand navigate back to the native screenABagain. There was no snapshot cache available.This is due to the fact that, historically, snapshots were only cached by core
turbo.jswhen navigating from web -> web screens. This resolves the issue by always caching a snapshot before navigating away from a web screen.