mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-20 20:43:09 -06:00
If we're going backwards, update latestPosition
This commit is contained in:
parent
b13cb43785
commit
7102be9d1c
|
|
@ -264,6 +264,9 @@ func (p *PDUStreamProvider) addRoomDeltaToResponse(
|
||||||
// Work out what the highest stream position is for all of the events in this
|
// Work out what the highest stream position is for all of the events in this
|
||||||
// room that were returned.
|
// room that were returned.
|
||||||
latestPosition := r.To
|
latestPosition := r.To
|
||||||
|
if r.Backwards {
|
||||||
|
latestPosition = r.From
|
||||||
|
}
|
||||||
updateLatestPosition := func(mostRecentEventID string) {
|
updateLatestPosition := func(mostRecentEventID string) {
|
||||||
var pos types.StreamPosition
|
var pos types.StreamPosition
|
||||||
if _, pos, err = snapshot.PositionInTopology(ctx, mostRecentEventID); err == nil {
|
if _, pos, err = snapshot.PositionInTopology(ctx, mostRecentEventID); err == nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue