You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I recognize that there are other issues similar or related to this one like #45 and if this has been covered elsewhere I apologize.
I am noticing that if I have a channel identified by current_user then if I submit a Turbo enabled authentication form (e.g. with Devise) then I don't have access to the current user through the ActionCable channel. A full refresh of the page establishes connection immediately. This behavior is also fixed by adding a turbo-false data element to the form. A final option that sort of works is to do something like this (note that this is with an ApplicationCable::Connection identified by both session id and current_user):
The problem with this last solution is that it takes several seconds for ActionCable to detect the stale connection which can lead to confusing UX for the user. The initial connection on page load is quite snappy in comparison.
My conclusion is that when Turbo handles the redirect the connection to ActionCable does not get refreshed.
Maybe just disabling turbo in the form is good enough but I am curious if there is a way and whether it would make sense for Turbo to trigger ActionCable to reconnect in such cases.
The text was updated successfully, but these errors were encountered:
So I recognize that there are other issues similar or related to this one like #45 and if this has been covered elsewhere I apologize.
I am noticing that if I have a channel identified by current_user then if I submit a Turbo enabled authentication form (e.g. with Devise) then I don't have access to the current user through the ActionCable channel. A full refresh of the page establishes connection immediately. This behavior is also fixed by adding a turbo-false data element to the form. A final option that sort of works is to do something like this (note that this is with an ApplicationCable::Connection identified by both session id and current_user):
The problem with this last solution is that it takes several seconds for ActionCable to detect the stale connection which can lead to confusing UX for the user. The initial connection on page load is quite snappy in comparison.
My conclusion is that when Turbo handles the redirect the connection to ActionCable does not get refreshed.
Maybe just disabling turbo in the form is good enough but I am curious if there is a way and whether it would make sense for Turbo to trigger ActionCable to reconnect in such cases.
The text was updated successfully, but these errors were encountered: