Explorar o código

Lock latest event backfill lock when handling Matrix messages

Tulir Asokan %!s(int64=2) %!d(string=hai) anos
pai
achega
5e28343350
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      portal.go

+ 2 - 0
portal.go

@@ -313,6 +313,8 @@ func (portal *Portal) handleMessageLoopItem(msg PortalMessage) {
 }
 
 func (portal *Portal) handleMatrixMessageLoopItem(msg PortalMatrixMessage) {
+	portal.latestEventBackfillLock.Lock()
+	defer portal.latestEventBackfillLock.Unlock()
 	evtTS := time.UnixMilli(msg.evt.Timestamp)
 	timings := messageTimings{
 		initReceive:  msg.evt.Mautrix.ReceivedAt.Sub(evtTS),