0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-06-01 03:59:03 +02:00

Fix a bug where we would accidentally skip over some events

This commit is contained in:
Till Faelligen 2024-05-15 11:02:23 +02:00
parent a7953fe3ff
commit fb5e1abe71
No known key found for this signature in database
GPG key ID: ACCDC9606D472758

View file

@ -400,6 +400,9 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.
reasonablePositions := findReasonableIncrementalSyncWindow(
syncReq.Since, rp.Notifier.CurrentPosition(),
)
// Also update the currentPos, which is used for the retry logic below.
// Otherwise we may skip over some events.
currentPos = reasonablePositions
syncReq.Response.NextBatch = types.StreamingToken{
PDUPosition: withTransaction(
syncReq.Since.PDUPosition,