Skip to content

Commit

Permalink
Update latestPosition when getting reversed room delta (#2860)
Browse files Browse the repository at this point in the history
Regression test added in
matrix-org/complement#551
Should fix #2514?
  • Loading branch information
S7evinK committed Nov 4, 2022
1 parent b13cb43 commit efe28db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions syncapi/streams/stream_pdu.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ func (p *PDUStreamProvider) addRoomDeltaToResponse(
// Work out what the highest stream position is for all of the events in this
// room that were returned.
latestPosition := r.To
if r.Backwards {
latestPosition = r.From
}
updateLatestPosition := func(mostRecentEventID string) {
var pos types.StreamPosition
if _, pos, err = snapshot.PositionInTopology(ctx, mostRecentEventID); err == nil {
Expand Down

0 comments on commit efe28db

Please sign in to comment.