mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 08:13:09 -06:00
Fix complete sync positions
This commit is contained in:
parent
8fdcd97108
commit
e5d7a00d82
|
|
@ -29,16 +29,14 @@ func (p *PDUStreamProvider) CompleteSync(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req *types.SyncRequest,
|
req *types.SyncRequest,
|
||||||
) types.StreamPosition {
|
) types.StreamPosition {
|
||||||
|
from := types.StreamPosition(0)
|
||||||
to := p.LatestPosition(ctx)
|
to := p.LatestPosition(ctx)
|
||||||
from := to - 20
|
|
||||||
if from < 0 {
|
|
||||||
from = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the current sync position which we will base the sync response on.
|
// Get the current sync position which we will base the sync response on.
|
||||||
r := types.Range{
|
r := types.Range{
|
||||||
From: from,
|
From: to,
|
||||||
To: to,
|
To: 0,
|
||||||
|
Backwards: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract room state and recent events for all rooms the user is joined to.
|
// Extract room state and recent events for all rooms the user is joined to.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue