diff --git a/lib/ably/realtime/connection.rb b/lib/ably/realtime/connection.rb index c6916421..4f07ca48 100644 --- a/lib/ably/realtime/connection.rb +++ b/lib/ably/realtime/connection.rb @@ -375,6 +375,7 @@ def configure_new(connection_id, connection_key) # @api private def reset_resume_info @key = nil + @id = nil end # @!attribute [r] __outgoing_protocol_msgbus__ diff --git a/lib/ably/realtime/connection/connection_manager.rb b/lib/ably/realtime/connection/connection_manager.rb index 69044113..05f81ce3 100644 --- a/lib/ably/realtime/connection/connection_manager.rb +++ b/lib/ably/realtime/connection/connection_manager.rb @@ -19,7 +19,8 @@ def initialize(connection) @connection = connection @timers = Hash.new { |hash, key| hash[key] = [] } - connection.unsafe_on(:closed) do + # RTN8c, RTN9c + connection.unsafe_on(:closing, :closed, :suspended, :failed) do connection.reset_resume_info end