hotwired / turbo

The speed of a single-page web application without having to write any JavaScript
https://turbo.hotwired.dev
MIT License
6.65k stars 421 forks source link

Turbo frame loads twice when it is in the response of a redirected request #526

Closed karthikkasturitg closed 2 years ago

karthikkasturitg commented 2 years ago

Using turbo-rails with turbo-frame :

Assuming there is a page with an anchor that links to "/page" and the /page action redirects to "/main" where we have a response of .html.erb as such: Frame here:

Expected behavior: On clicking the link to /page, main.html.erb should be loaded and since the response has a turbo frame, "/test/frame" should be called once to load the data for the frame

Actual behavior: "/test/frame" is called twice.

Can be replicated on: https://github.com/karthikkasturi/turbo-frame-loads-twice-on-redirect

blrB commented 2 years ago

I think it is a duplicate of issue #515 and PR #516 will resolve this issue.

dhh commented 2 years ago

Solved via https://github.com/hotwired/turbo/pull/516