Closed jimeh closed 3 years ago
Can confirm this is happening on my Turbolinks-enabled app as well (Rails 6.1.0, Turbolinks 5.2.0).
@OsamaSayegh can you investigate?
I've opened https://github.com/MiniProfiler/rack-mini-profiler/pull/474 to fix this. Thank you so much @jimeh for the proof of concept, it was really helpful for debugging this issue 👍
@zokioki / @jimeh can you confirm it corrects the issue? If so I will push a new version of the gem out there.
@SamSaffron Confirming that this does fix the issue in my case - thanks y'all! 👍
Sorry for my delayed response.
I can confirm it has fixed the issue on my end as well. I've updated the demo Rails app as proof too: https://cryptic-dawn-20880.herokuapp.com/hello/page_a
@OsamaSayegh thanks for the fix :)
I believe there's an issue around JavaScript event handlers which register themselves on page load to fetch profiler results from
/mini-profiler-resources/results
. Each time a Turbolinks link is clicked, it seems to create another results fetcher handler, leading to an ever increasing number of duplicated handlers making identical requests to/mini-profiler-resources/results
.I have a basic proof of concept app:
It's a blank Rails 6 app, two pages with links back and forth between them, and rack-mini-profiler added.
And here's a gif of if too for good measure: