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

Double page requests when interacting with modals #12

Closed
joemasilotti opened this issue Apr 6, 2024 · 5 comments
Closed

Double page requests when interacting with modals #12

joemasilotti opened this issue Apr 6, 2024 · 5 comments
Assignees

Comments

@joemasilotti
Copy link
Member

In merging outstanding PRs from turbo-ios I learned that PR #155 doesn't play nicely with Turbo Navigator. It can cause screens to not render at all due to the cached visit options being out of sync. I decided to skip the merge (for now) because it was causing more issues than it fixed.

A new, and I think related, issue has popped up instead. Using the Demo app, double requests are not being made to anything related to modals.

Launching the demo app and:

  1. Tapping "Load a webpage modally" requests /new twice
  2. Submitting the form POSTs once correctly but requests /success twice
@olivaresf
Copy link
Member

This should be fixed in #24.

@olivaresf
Copy link
Member

@joemasilotti could you help me review #24? I believe that should fix the issue.

@joemasilotti
Copy link
Member Author

I'm still seeing the same behavior of modals and form submissions hitting twice in the demo app (and same for my Rails server):

Mon Oct 21 2024 11:09:00 GMT-0700 (Pacific Daylight Time) -- GET /new
Mon Oct 21 2024 11:09:00 GMT-0700 (Pacific Daylight Time) -- GET /new
Mon Oct 21 2024 11:09:01 GMT-0700 (Pacific Daylight Time) -- POST /new
Mon Oct 21 2024 11:09:01 GMT-0700 (Pacific Daylight Time) -- GET /success
Mon Oct 21 2024 11:09:01 GMT-0700 (Pacific Daylight Time) -- GET /success

@jayohms
Copy link
Contributor

jayohms commented Dec 16, 2024

Note, this issue is due to two completely separate issues:

  1. Double-requests to /new is due to Turbo link prefetching being initiated when tapping on the /new link, but prefetching results won't work across multiple default/modal WKWebView sessions. To address this, we plan to disable prefetching in the native libraries, since link taps was not an expected use of prefetching anyway (as opposed to mouse hover events).
  2. Double-requests to /success is due to the issue outlined in this PR: Fix double-visits after modal form submission redirects #60

@jayohms
Copy link
Contributor

jayohms commented Dec 18, 2024

@jayohms jayohms closed this as completed Dec 18, 2024
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