0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-02 13:48:53 +02:00

modules/client/sync: Try to ensure all next_batch tokens are limited to the upper bound.

This commit is contained in:
Jason Volk 2019-03-16 17:42:21 -07:00
parent 1ce9ec3f8e
commit 4e618175c7

View file

@ -380,7 +380,7 @@ try
last && completed? last && completed?
data.range.second: data.range.second:
last? last?
last + 1: std::min(last + 1, data.range.second):
0UL 0UL
}; };
@ -651,7 +651,7 @@ ircd::m::sync::longpoll::handle(data &data,
const auto next const auto next
{ {
data.event_idx? data.event_idx?
data.event_idx + 1: std::min(data.event_idx + 1, vm::current_sequence + 1):
data.range.first data.range.first
}; };