Skip to content

Commit

Permalink
Don't add the current connection to the connections array until after…
Browse files Browse the repository at this point in the history
… all the callbacks are run
  • Loading branch information
lifo committed Oct 14, 2015
1 parent af7ddfc commit 773d3c2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/action_cable/connection/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,12 @@ def cookies
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
Expand Down

0 comments on commit 773d3c2

Please sign in to comment.