ActionCable Continuous Connect / Disconnect Circuit

My rails application uses an ActionCable stone configured as a single channel chat application.

The close event continues to be called and then resumes continuously. My Rails server sees the connection correctly; loop happens in browser / javascript.

Connection.prototype.events = { message: function(event) { var identifier, message, ref; ref = JSON.parse(event.data), identifier = ref.identifier, message = ref.message; return this.consumer.subscriptions.notify(identifier, "received", message); }, open: function() { this.disconnected = false; return this.consumer.subscriptions.reload(); }, close: function() { return this.disconnect(); }, error: function() { return this.disconnect(); } }; 

Has anyone experienced this problem?

+5
source share
2 answers

Make sure that you are using a server other than thin. I had this problem and I tapped my head on the keyboard for 3 days until I tried another server (puma) and was able to solve my problem. https://github.com/puma/puma

+1
source

Im experiencing the same problem and I found out that this is due to ping messages that the server must send to the client. At my end, the client does not receive them, but it successfully receives a message with channel X.

Edit: @vanboom, please check if you are linking to actioncable in your gemfile as follows:

  gem 'actioncable', github: "rails/actioncable", branch: 'archive' 
-1
source

All Articles