From 773d3c2310b12ab808b4434168ad5f017361712b Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Wed, 14 Oct 2015 18:12:58 -0500 Subject: Don't add the current connection to the connections array until after all the callbacks are run --- lib/action_cable/connection/base.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/action_cable') diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb index 15229242f6..2443b03018 100644 --- a/lib/action_cable/connection/base.rb +++ b/lib/action_cable/connection/base.rb @@ -143,13 +143,12 @@ module ActionCable attr_reader :subscriptions, :message_buffer def on_open - server.add_connection(self) - connect if respond_to?(:connect) subscribe_to_internal_channel beat message_buffer.process! + server.add_connection(self) rescue ActionCable::Connection::Authorization::UnauthorizedError respond_to_invalid_request close -- cgit v1.2.3