Skip to content

Commit

Permalink
Added separate method for creating a recovery key
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed May 16, 2024
1 parent 148ba15 commit 7df5ef5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/ably/realtime/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,14 @@ def internet_up?
# @return [String]
#
def recovery_key
"#{key}:#{serial}:#{message_serial}" if connection_resumable?
create_recovery_key
end

def create_recovery_key
if key.nil? || key.empty? || state == :closing || state == :closed || state == :failed || state == :suspended
return "";
end
RecoveryKeyContext.to_json(key, message_serial, client.channels.get_channel_serials)
end

# Following a new connection being made, the connection ID, connection key
Expand Down

0 comments on commit 7df5ef5

Please sign in to comment.