Skip to content

Commit

Permalink
Fixed newer presencemessage checks and decoding recovery key
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Apr 19, 2024
1 parent 131ea1c commit 1771318
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/IO.Ably.Shared/Extensions/PresenceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static bool IsNewerThan(this PresenceMessage thisMessage, PresenceMessage
// RTP2b1
if (thisMessage.IsSynthesized() || thatMessage.IsSynthesized())
{
return thisMessage.Timestamp > thatMessage.Timestamp;
return thisMessage.Timestamp >= thatMessage.Timestamp;
}

// RTP2b2
Expand All @@ -35,7 +35,7 @@ public static bool IsNewerThan(this PresenceMessage thisMessage, PresenceMessage

if (msgSerialThis == msgSerialThat)
{
return indexThis > indexThat;
return indexThis >= indexThat;
}

return msgSerialThis > msgSerialThat;
Expand Down
4 changes: 2 additions & 2 deletions src/IO.Ably.Shared/Realtime/RecoveryKeyContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public static RecoveryKeyContext Decode(string recover, ILogger logger = null)
{
return JsonHelper.Deserialize<RecoveryKeyContext>(recover);
}
catch (Exception)
catch (Exception e)
{
logger?.Warning($"Error deserializing recover - {recover}, setting it as null");
logger?.Warning($"Error deserializing recover - {recover}, setting it as null", e);
return null;
}
}
Expand Down

0 comments on commit 1771318

Please sign in to comment.