diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2015-10-14 18:12:58 -0500 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2015-10-14 18:13:01 -0500 |
commit | 773d3c2310b12ab808b4434168ad5f017361712b (patch) | |
tree | 544d1950c63a4fb690bc6901c897a691afc65888 /lib/action_cable | |
parent | af7ddfce698c79bfa7276015f1e2c947d6135261 (diff) | |
download | rails-773d3c2310b12ab808b4434168ad5f017361712b.tar.gz rails-773d3c2310b12ab808b4434168ad5f017361712b.tar.bz2 rails-773d3c2310b12ab808b4434168ad5f017361712b.zip |
Don't add the current connection to the connections array until after all the callbacks are run
Diffstat (limited to 'lib/action_cable')
-rw-r--r-- | lib/action_cable/connection/base.rb | 3 |
1 files changed, 1 insertions, 2 deletions
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 |