mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-26 05:31:32 +00:00
Another /sync
fix
This commit is contained in:
parent
3617d5a0ff
commit
7d9545ceea
@ -156,11 +156,13 @@ func (p *PDUStreamProvider) IncrementalSync(
|
|||||||
if req.WantFullState {
|
if req.WantFullState {
|
||||||
if stateDeltas, syncJoinedRooms, err = snapshot.GetStateDeltasForFullStateSync(ctx, req.Device, r, req.Device.UserID, &stateFilter); err != nil {
|
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")
|
req.Log.WithError(err).Error("p.DB.GetStateDeltasForFullStateSync failed")
|
||||||
|
_ = snapshot.Rollback()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if stateDeltas, syncJoinedRooms, err = snapshot.GetStateDeltas(ctx, req.Device, r, req.Device.UserID, &stateFilter); err != nil {
|
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")
|
req.Log.WithError(err).Error("p.DB.GetStateDeltas failed")
|
||||||
|
_ = snapshot.Rollback()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -175,6 +177,7 @@ func (p *PDUStreamProvider) IncrementalSync(
|
|||||||
|
|
||||||
if err = p.addIgnoredUsersToFilter(ctx, snapshot, req, &eventFilter); err != nil {
|
if err = p.addIgnoredUsersToFilter(ctx, snapshot, req, &eventFilter); err != nil {
|
||||||
req.Log.WithError(err).Error("unable to update event filter with ignored users")
|
req.Log.WithError(err).Error("unable to update event filter with ignored users")
|
||||||
|
_ = snapshot.Rollback()
|
||||||
}
|
}
|
||||||
|
|
||||||
newPos = from
|
newPos = from
|
||||||
@ -194,7 +197,11 @@ func (p *PDUStreamProvider) IncrementalSync(
|
|||||||
var pos types.StreamPosition
|
var pos types.StreamPosition
|
||||||
if pos, err = p.addRoomDeltaToResponse(ctx, snapshot, req.Device, newRange, delta, &eventFilter, &stateFilter, req.Response); err != nil {
|
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")
|
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
|
// Reset the position, as it is only for the special case of newly joined rooms
|
||||||
if delta.NewlyJoined {
|
if delta.NewlyJoined {
|
||||||
|
Loading…
Reference in New Issue
Block a user