-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Websocket disconnects after first reloading in Rails 7.1 #49
Comments
Hi, there, I wanted to note a follow-up as I had this issue as well. Turns out, for me, it ended up being a problem in my When I added a conditional block to account for a websocket request, all was good and this error no longer appears and, most importantly, reloading happened again :) Thanks to all for the work on this hugely helpful gem! |
I continue investigating this issue. So far I found out that websocket got disconnected due to ActionCable server restart: |
I've faced the issue too. However, if you go with |
I've run into this issue as well. Using |
@pjg did you try setting up a |
@mrfullset I tried, but it didn't change anything. I have plain CSS without any preprocessors, so this setting seems to not be applicable to me. What I'm seeing is that for any change I make in a html or css file, I can see in server's logs it being broadcasted:
but then it doesn't update on the browser side. And then after a short while I get another request for /cable (with "upgrade"):
And then the next file save will trigger a proper refresh. Maybe I should file a new issue for this? |
I've encountered this issue as well. After debugging ActionCable, it appears the problem isn't isolated to ActionCable alone, but rather an interaction between ActionCable and Turbo. There might be a conflict or a recent Turbo update causing this behavior. I couldn't find the exact reason for the The solution I found is implemented in this PR #62 . It introduces an early reconnect, which feels almost instantaneous and is a significant improvement over the 10-second delay. While I'm not certain if this should be considered a permanent fix or a temporary workaround, it effectively addresses the issue. I found this, Im unsure perhaps is related with |
@LEstradioto great work with #62 👏 Let's keep it as a temporary workaround until we'll find out how to prevent ActionCable server restart. But nothing is more permanent than temporary. From my investigation, the issue is related to classes autoloading changes in Rails 7.1. ActionCable classes are being unloaded which causes server restart. I was able to trace it to this code but, couldn't find what exactly causing the unload: https://github.com/rails/rails/blob/main/actioncable/lib/action_cable/engine.rb#L91 |
CleanShot.2023-11-27.at.13.38.49.mp4
The text was updated successfully, but these errors were encountered: