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

Breaking change in 7.2, when frame response is 4xx, 5xx OR if frame is missing #407

Closed
cabgfx opened this issue Dec 8, 2022 · 2 comments

Comments

@cabgfx
Copy link

cabgfx commented Dec 8, 2022

On updating from Turbo 7.1.x to to 7.2.x, via turbo-rails, we were quite surprised to see frames suddenly doing full-page redirects on failures, ie. for a 4xx or 5xx response.

I'm aware of hotwired/turbo#445, and the reasoning behind the turbo:frame-missing event, quite useful!

However, the changes introduced in hotwired/turbo#693, where Turbo now transforms 4xx and 5xx responses to full-page Visits, feel like a breaking change. The minor version bump from 7.1 to 7.2 certainly broke our app 😅

I've read up on the discussion in hotwired/turbo#670, and noticed this sentiment by @seanpdoyle :

Scenarios like this make me nervous about breaking the hotwired/turbo#94 (comment) that a navigation within a frame will stay within a frame.

I believe the changes introduced in 7.2 specifically break that “promise”: a navigation within a frame will stay within a frame

Are hotwired Rails apps now required to add additional/custom JS to handle this scenario by default?

And, if so, should this repo add the necessary JS to handle this, upon doing ./bin/rails turbo:install ?
Or am I simply misunderstanding something? (quite possible!)

I'm raising the issue here, instead of hotwired/turbo, as I'm mostly trying to find out how to fix this going forward, and perhaps help other newbies like myself.


Related:

@brunoprietog
Copy link
Contributor

I agree, this drastically changes behavior. Even if a Turbo frame takes a while to load, Turbo also does a page redirect. I had to add event listeners to handle these cases, which is not desirable.

@dhh
Copy link
Member

dhh commented Jan 3, 2023

We have some thoughts on how to improve this behavior going forward, but in any case, we can't do anything from this repo. Discussion needs to happen on the turbo repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants