Skip to content

refreshHistoricalLocation does not refresh when triggered consecutively #224

@marcelobalexandre

Description

@marcelobalexandre

I believe I have found a bug related with the refreshHistoricalLocation.

I have a page where the user can click on an Add button to open a modal that when submitted will trigger a refresh_or_redirect_to in the Rails side, this works fine the first time the modal is submitted (it correctly closes the modal and refresh the main page), but if the user tries to open the modal again and submit a new form, the modal is closed but the main page displays an old version (the screenshot from the first time it was opened).

Recording of the bug:

Screen.Recording.2026-01-29.at.14.56.31.mov

Possible solution

If I change the Navigator.refreshVisitable (https://github.com/hotwired/hotwire-native-ios/blob/main/Source/Turbo/Navigator/Navigator.swift#L256) from .restore to .replace it works as I expected.

Recording of this "fix":

Screen.Recording.2026-01-29.at.14.57.54.mov

I don't have experience with iOS development, but if that's indeed a bug as I believe it is I can try to work on a PR to fix it. I would appreciate some guidance to understand if this is the right fix for the issue and what would be a good way to write tests to cover it.

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