mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-25 15:53:09 -06:00
Only apply receipts on initial sync or if edu positions differ,
otherwise we'll be sending the same receipts over and over again.
This commit is contained in:
parent
3a5c8256df
commit
02a11d5a8f
|
|
@ -633,9 +633,12 @@ func (d *Database) addEDUDeltaToResponse(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// always check for receipt deltas; otherwise an initial sync won't receive receipts
|
// Check on initial sync and if EDUPositions differ
|
||||||
if err := d.addReceiptDeltaToResponse(fromPos, joinedRoomIDs, res); err != nil {
|
if (fromPos.EDUPosition() == 0 && toPos.EDUPosition() == 0) ||
|
||||||
return errors.Wrap(err, "unable to apply receipts to response")
|
fromPos.EDUPosition() != toPos.EDUPosition() {
|
||||||
|
if err := d.addReceiptDeltaToResponse(fromPos, joinedRoomIDs, res); err != nil {
|
||||||
|
return errors.Wrap(err, "unable to apply receipts to response")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue