diff --git a/src/github.com/matrix-org/dendrite/federationsender/consumers/roomserver.go b/src/github.com/matrix-org/dendrite/federationsender/consumers/roomserver.go index 693fc4e1d..b9a2e6c04 100644 --- a/src/github.com/matrix-org/dendrite/federationsender/consumers/roomserver.go +++ b/src/github.com/matrix-org/dendrite/federationsender/consumers/roomserver.go @@ -137,6 +137,8 @@ func (s *OutputRoomEvent) processMessage(ore api.OutputNewRoomEvent) error { if oldJoinedHosts == nil { // This means that there is nothing to update as this is a duplicate // message. + // This can happen if dendrite crashed between reading the message and + // persisting the stream position. return nil } diff --git a/src/github.com/matrix-org/dendrite/federationsender/storage/storage.go b/src/github.com/matrix-org/dendrite/federationsender/storage/storage.go index 8e577de45..ab97dc449 100644 --- a/src/github.com/matrix-org/dendrite/federationsender/storage/storage.go +++ b/src/github.com/matrix-org/dendrite/federationsender/storage/storage.go @@ -84,7 +84,9 @@ func (d *Database) UpdateRoom( } if lastSentEventID == newEventID { - // We've handled this messages before, so lets just ignore it + // We've handled this message before, so let's just ignore it. + // We can only get a duplicate for the last message we processed, + // so its enough just to compare the newEventID with lastSentEventID return nil }