Ask A Question

Notifications

You’re not receiving notifications from this thread.

Realtime Group Chat with Rails [Revised] - Part 3 Discussion

Hi,

(I've now run through the videos, implementing them from scratch to this point twice, and still getting the same issue)

Looking at the frames in the cable entry in the Network tab of Dev Tools, whenever a user changes channel (after the first change, so say, load channel 1, change to channel 2, then change to 1), there's an extra pair of unsubscription/subscribe events appearing for the same channel:

i.e. I get:

Unsubscribe 2
Subscribe 1
confirm subscription
Unsubscribe 2
Subscribe 2
(but crucially no confirm subscription)

As soon as the above happens, then the log shows:

19:37:43 web.1 | [ActionCable] [User 1] Unsubscribing from channel: {"channel":"MessageChannel","id":"1"}
19:37:43 web.1 | [ActionCable] [User 1] MessageChannel stopped streaming from message:Z2lkOi8vY2hhdC9DaGFubmVsLzE

and the sending back of new messages is broken.

Anyone have any thoughts?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.