My rails application is using the ActionCable gem, configured as a simple chat application with one channel.
The close event keeps getting called, then reopened continuously. My Rails server is seeing the connection properly; the loop is happening in the 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 issue?
Make sure you are using a server other than thin. I had this issue and banged my head against my keyboard for 3 days until trying a different server (puma) and was able to solve my issue. https://github.com/puma/puma
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With