Skip to content

Commit

Permalink
Fixed logic for checking newer presence message
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Jan 16, 2024
1 parent b185b71 commit d7051da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ably/proto_presence_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (msg *PresenceMessage) getMsgSerialAndIndex() (int64, int64, error) {
func (msg1 *PresenceMessage) IsNewerThan(msg2 *PresenceMessage) (bool, error) {
// RTP2b1
if msg1.isServerSynthesized() || msg2.isServerSynthesized() {
return msg1.Timestamp > msg2.Timestamp, nil
return msg1.Timestamp >= msg2.Timestamp, nil
}

// RTP2b2
Expand All @@ -98,7 +98,7 @@ func (msg1 *PresenceMessage) IsNewerThan(msg2 *PresenceMessage) (bool, error) {
return true, err
}
if msg1Serial == msg2Serial {
return msg1Index > msg2Index, nil
return msg1Index >= msg2Index, nil
}
return msg1Serial > msg2Serial, nil
}

0 comments on commit d7051da

Please sign in to comment.