Skip to content

Advance and replace actions do not update the session URL or call delegate methods #213

@adampal

Description

@adampal

Hey guys,
Thanks for all your amazing work on Turbo Native! We're running a turbo native app and have hit an issue when using the advance and replace actions.

When a turbo frame has data-turbo-action="advance" set, the navigation is promoted to a page visit and the URL in the browser is updated. However, the Session URL in Turbo Native is not updated.

This is causing an issue for us because we have a dashboard that displays various dates to the user. When the user navigates to a new date, we use a Turbo Frame to just change the relevant content. Because the URL is updated, if the user refreshes the page, they will see the latest date they viewed.

Because Turbo Native isn't updating the URL though, if the user refreshes the page, they go back to the last date that was loaded when they first launched the app.

It seems like there's also a change in v7.1.0 where now when a user navigates between two different tabs in the app, going back to the original tab triggers a new session request. This means if you navigate to a particular date in the dashboard tab, then swap to a different tab then back to the dashboard tab, the page flashes and you end up back on the initial dashboard date as opposed to the one you just navigated to.

The sessionDidStartRequest (and other related delegate methods) are not fired for an advance action either so there's no way to hook into the request and manually update the session URL from within the app.

For an advance and replace action given we're promoting them to full page navigations, it feels like we should be calling those delegate methods and updating the session's URL so we have consistent behaviour between the web and native versions of Turbo.

If this seems like behaviour we would want, I'm happy to try to put together a PR with the update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions