Fix issue with sync API not advancing.
Issue: During conversation, under some conditions, sync cookie is not advanced, and, as a result, client loops on the same sync API call creating high traffic and CPU load.
Fix: pdu component of cookie was updated incorrectly.
MODIFY
syncapi/streams/stream_pdu.go
syncapi/streams/stream_pdu.go
@@ -261,9 +261,9 @@ func (p *PDUStreamProvider) addRoomDeltaToResponse(
var pos types.StreamPosition
if _, pos, err = p.DB.PositionInTopology(ctx, mostRecentEventID); err == nil {
switch {
- case r.Backwards && pos > latestPosition:
+ case r.Backwards && pos < latestPosition:
fallthrough
- case !r.Backwards && pos < latestPosition:
+ case !r.Backwards && pos > latestPosition:
latestPosition = pos
}
}

Fix issue with sync API not advancing. (#2603)

Issue: During conversation, under some conditions, sync cookie is not advanced, and, as a result, client loops on the same sync API call creating high traffic and CPU load.
Fix: pdu component of cookie was updated incorrectly.