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

Getting the reloaded twice after a redirect_back from a turbo_stream request #1362

Open
titanve opened this issue Jan 15, 2025 · 2 comments
Open

Comments

@titanve
Copy link

titanve commented Jan 15, 2025

Hi,

I'm getting the page reloaded after redirect_back from a turbo_stream request, in simple words:

  1. Submit a form (from the show action from the first controller) that goes with formats turbo_stream (Why formats turbo_stream? Because I need to render the errors back to the form if any)
  2. The request goes to the second controller to be processed and then in this controller we redirect_back
  3. The request is now back to the first controller and arrived as a turbo_stream request and there I render the show template as formats: :html
  4. I get the show view rendered and it loads the first time (which is good) and then it reloads it again for a second time (which is wrong)

Take a look here:

Image

The question is, how may I prevent the second loading to happen?

Thanks.

@titanve
Copy link
Author

titanve commented Jan 15, 2025

I can see in the Request call stack pageInvalidated

Image

I looked for it and found:

Image

@titanve
Copy link
Author

titanve commented Jan 15, 2025

I am also seeing that the initiator is the same between the submit request and the redirect_back, the question is why the submitBubbled is kept during the redirect_back

Image

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

1 participant