diff --git a/lib/ably/realtime/client.rb b/lib/ably/realtime/client.rb index 1f0e0bb1..4ca31fe6 100644 --- a/lib/ably/realtime/client.rb +++ b/lib/ably/realtime/client.rb @@ -131,7 +131,7 @@ def initialize(options) @connection = Ably::Realtime::Connection.new(self, options) unless @recover.empty? - recovery_context = RecoveryKeyContext.from_json(@recover) + recovery_context = RecoveryKeyContext.from_json(@recover, logger) unless recovery_context.nil? @channels.set_channel_serials recovery_context.channel_serials @connection.message_serial = recovery_context.msg_serial # RTN16f diff --git a/lib/ably/realtime/connection.rb b/lib/ably/realtime/connection.rb index a99354e4..320ba88e 100644 --- a/lib/ably/realtime/connection.rb +++ b/lib/ably/realtime/connection.rb @@ -483,11 +483,11 @@ def create_websocket_transport url_params.merge! resume: key logger.debug { "Resuming connection with key #{key}" } elsif not (client.recover.nil? || client.recover.empty?) - recovery_context = RecoveryKeyContext.from_json client.recover + recovery_context = RecoveryKeyContext.from_json(client.recover, logger) unless recovery_context.nil? key = recovery_context.connection_key logger.debug { "Recovering connection with key #{key}" } - url_params.merge! resume: key + url_params.merge! recover: key end end