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

Fix snapshot cache issue in Turbo Navigator #183

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

joemasilotti
Copy link
Member

@joemasilotti joemasilotti commented Feb 28, 2024

This PR fixes the following issue where the snapshot cache doesn't get cleared.

To recreate:

  1. Present a modal that submits a form - this calls `clearSnapshotCache()
  2. Navigate back

Expected behavior:

The flash message appears on the redirected to page. Navigating back reloads the page from the server.

Actual behavior:

The flash message is "eaten" by Rails because turbo-ios makes two requests to the show page. Navigating back shows the stale content because the snapshot cache was never cleared.

PR behavior:

(same as expected)

Notes:

This PR assumes that PR #184 is merged into turbo-ios (this PR cherry-picks that commit).

@joemasilotti joemasilotti changed the base branch from main to turbo-navigator February 28, 2024 19:20
@joemasilotti joemasilotti merged commit 0ee7745 into turbo-navigator Feb 28, 2024
1 check passed
@joemasilotti joemasilotti deleted the turbo-navigator-snapshot-cache-issue branch February 28, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant