This repository was archived by the owner on Sep 25, 2021. It is now read-only.

Description
It looks as though visitRendered is being triggered twice after an initial load when a page is loaded using the Turbolinks.visit method.
I've been able to reproduce using a clean Rails 6 project and the a clean Turbolinks Demo app.
To reproduce:
- Create a new Rails 6 (I'm using 6.0.2) app and some new view/controller you can visit. Start the server.
- Download the turbolinks-ios library and run the TurbolinksDemo project.
- Update the URL in the iOS project to hit your local server.
- Open the web inspector in Safari and access the console
- Add a breakpoint to
visitRendered in the injected script (user-script)
- Run
Turbolinks.visit('/')
visitRendered is triggered once (correctly)
- Run
Turbolinks.visit('/') again
visitRendered is triggered twice
- Interestingly, only one HTTP request is made.
This results in two visitableDidRender calls in the iOS app which is negatively impacting my application as I do some additional view controller configuration post render.
Would appreciate it if someone could try the above and report if they are able to reproduce.