mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Another /sync
fix
This commit is contained in:
parent
3617d5a0ff
commit
7d9545ceea
1 changed files with 8 additions and 1 deletions
|
@ -156,11 +156,13 @@ func (p *PDUStreamProvider) IncrementalSync(
|
|||
if req.WantFullState {
|
||||
if stateDeltas, syncJoinedRooms, err = snapshot.GetStateDeltasForFullStateSync(ctx, req.Device, r, req.Device.UserID, &stateFilter); err != nil {
|
||||
req.Log.WithError(err).Error("p.DB.GetStateDeltasForFullStateSync failed")
|
||||
_ = snapshot.Rollback()
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if stateDeltas, syncJoinedRooms, err = snapshot.GetStateDeltas(ctx, req.Device, r, req.Device.UserID, &stateFilter); err != nil {
|
||||
req.Log.WithError(err).Error("p.DB.GetStateDeltas failed")
|
||||
_ = snapshot.Rollback()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -175,6 +177,7 @@ func (p *PDUStreamProvider) IncrementalSync(
|
|||
|
||||
if err = p.addIgnoredUsersToFilter(ctx, snapshot, req, &eventFilter); err != nil {
|
||||
req.Log.WithError(err).Error("unable to update event filter with ignored users")
|
||||
_ = snapshot.Rollback()
|
||||
}
|
||||
|
||||
newPos = from
|
||||
|
@ -194,7 +197,11 @@ func (p *PDUStreamProvider) IncrementalSync(
|
|||
var pos types.StreamPosition
|
||||
if pos, err = p.addRoomDeltaToResponse(ctx, snapshot, req.Device, newRange, delta, &eventFilter, &stateFilter, req.Response); err != nil {
|
||||
req.Log.WithError(err).Error("d.addRoomDeltaToResponse failed")
|
||||
return to
|
||||
_ = snapshot.Rollback()
|
||||
if err == context.DeadlineExceeded || err == context.Canceled {
|
||||
return newPos
|
||||
}
|
||||
continue // return to
|
||||
}
|
||||
// Reset the position, as it is only for the special case of newly joined rooms
|
||||
if delta.NewlyJoined {
|
||||
|
|
Loading…
Reference in a new issue