Skip to content

Commit

Permalink
Updated recovery error message as per suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Jan 14, 2024
1 parent f3d3e70 commit 22f1e54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ably/realtime_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func NewRealtime(options ...ClientOption) (*Realtime, error) {
if !empty(c.opts().Recover) {
recoverKeyContext, err := DecodeRecoveryKey(c.opts().Recover)
if err != nil {
// Ignoring error since no recover will be used for new connection
c.log().Errorf("Error decoding recover with error %v", err)
c.log().Errorf("Trying a fresh connection instead")
} else {
c.Channels.SetChannelSerialsFromRecoverOption(recoverKeyContext.ChannelSerials) // RTN16j
c.Connection.msgSerial = recoverKeyContext.MsgSerial // RTN16f
Expand Down
4 changes: 3 additions & 1 deletion ably/realtime_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ func (c *Connection) params(mode connectionMode) (url.Values, error) {
case recoveryMode:
recoveryKeyContext, err := DecodeRecoveryKey(c.recover)
if err != nil {
c.log().Errorf("error decoding recovery key, %v", err)
// Ignoring error since no recover will be used for new connection
c.log().Errorf("Error decoding recovery key, %v", err)
c.log().Errorf("Trying a fresh connection instead")
} else {
query.Set("recover", recoveryKeyContext.ConnectionKey) // RTN16k
}
Expand Down

0 comments on commit 22f1e54

Please sign in to comment.