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

Bugfix: Redirects and [data-turbo-cache=false] #674

Merged
merged 1 commit into from
Aug 11, 2022

Commits on Aug 9, 2022

  1. Bugfix: Redirects and [data-turbo-cache=false]

    When redirecting to a page that contains elements marked with
    `[data-turbo-cache="false"]`, those elements are removed _before_ the
    initial render, instead of _after_ the render and _before_ the page is
    cached.
    
    This behavior seems to have stemmed from [hotwired#516][], which
    was shipped in response to [hotwired#515][].
    
    As an alternative to the `willRender: false` option passed to
    `this.adapter.visitProposedToLocation` in `Visit.followRedirect`, the
    implementation can instead [rely on the presence of the
    `turbo-frame[complete]`][comment] to guard against double fetching.
    
    To guard against regressions, this commit adds coverage for the unwanted
    behavior by redirecting from `navigation.html` to `cache_observer.html`,
    and asserting the presence of a `[data-turbo-cache="false"]` element
    that resembles and application's Flash messaging.
    
    [hotwired#515]: hotwired#515
    [hotwired#516]: hotwired#516
    [comment]: hotwired#515 (comment)
    [hotwired#487]: hotwired#487
    seanpdoyle committed Aug 9, 2022
    Configuration menu
    Copy the full SHA
    7988314 View commit details
    Browse the repository at this point in the history