Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Fix a bug where we would accidentally skip over some events
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK committed May 15, 2024
1 parent a7953fe commit fb5e1ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions syncapi/sync/requestpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fb5e1ab

Please sign in to comment.