Skip to content

Commit

Permalink
Fixed race condition while entering presence members from internal map
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Nov 20, 2023
1 parent 7d36865 commit ace96a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ably/realtime_presence.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ func syncSerial(msg *protocolMessage) (noChannelSerial bool, syncSequenceId stri
}

func (pres *RealtimePresence) enterMembersFromInternalPresenceMap() {
for _, member := range pres.internalMembers {
pres.mtx.Lock()
internalMembers := pres.internalMembers
pres.mtx.Unlock()
for _, member := range internalMembers {
// RTP17g
err := pres.EnterClient(context.Background(), member.ClientID, member.Data)
// RTP17e
Expand Down

0 comments on commit ace96a0

Please sign in to comment.