-
Notifications
You must be signed in to change notification settings - Fork 430
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
Turbo stream refresh takes precedence over user interaction #1209
Comments
Closes [hotwired#1209] Defers the `Session.refresh` calls while handling `<turbo-stream action="refresh">` elements if there is a `Visit` that's already initiated and being handled by the `Navigator`. [hotwired#1209]: hotwired#1209
Thank you for opening this issue, and thank you for sharing a bug report repository. If the root of the issue is that receiving a Are you able to consume that fork's branch and test whether or not it resolves your application's issues? |
Thank you for the quick reply! I've gone ahead and applied the changes locally and it seems that only-one-refresh.movI went ahead and threw a breakpoint in and it looks like only-one-refresh-with-debugging.mp4Full disclosure: I was having a little bit of trouble getting a local build of Turbo that I could point to in my rails project with actioncable working so I just went ahead and directly modified |
Closes [hotwired#1209] Defers the `Session.refresh` calls while handling `<turbo-stream action="refresh">` elements if there is a `Visit` that's already initiated and being handled by the `Navigator`. [hotwired#1209]: hotwired#1209
Closes [hotwired#1209] Defers the `Session.refresh` calls while handling `<turbo-stream action="refresh">` elements if there is a `Visit` that's already initiated and being handled by the `Navigator`. [hotwired#1209]: hotwired#1209
Closes [hotwired#1209] Defers the `Session.refresh` calls while handling `<turbo-stream action="refresh">` elements if there is a `Visit` that's already initiated and being handled by the `Navigator`. [hotwired#1209]: hotwired#1209
Closes [hotwired#1209] Defers the `Session.refresh` calls while handling `<turbo-stream action="refresh">` elements if there is a `Visit` that's already initiated and being handled by the `Navigator`. [hotwired#1209]: hotwired#1209
I am running into a bit of an interesting race condition when using Turbo 8 with broadcasted
refresh
actions. It seems that the streaming refresh action takes precedence over user interactions on the page, meaning a user could click a link on a page and instead receive the refresh response of the previous page. I've attached a video of the behavior and a simple repository to reproduce the issue. In this video I have simulated an app that is a bit slower to respond by adding a 2 second delay to the index route, and then I am clicking on the headings in order to sort the users list.Clicks.being.overridden.turbo.mov
In the console at the bottom of the screen you can see my click action fire and then be cancelled by the turbo stream refresh streaming from the server. Also note that the list maintains it's original order.
The demo app in the video can be found at: https://github.com/rbclark/turbo-8-stimulus-bug-demo. I've tried playing around with different ways of disabling turbo refreshes once the user has interacted with the page using the different
turbo:before-*
events but so far to no avail.The text was updated successfully, but these errors were encountered: