mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
modules/client/sync/rooms: Don't skip sync routines based on room head index.
This commit is contained in:
parent
3e9b830206
commit
05f39b03d6
4 changed files with 32 additions and 7 deletions
|
@ -93,17 +93,26 @@ ircd::m::sync::_rooms_polylog(data &data,
|
|||
data.user_rooms.for_each(membership, [&data]
|
||||
(const m::room &room, const string_view &membership_)
|
||||
{
|
||||
#ifdef RB_DEBUG
|
||||
const auto head_idx
|
||||
{
|
||||
m::head_idx(std::nothrow, room)
|
||||
};
|
||||
|
||||
assert(head_idx); // room should exist
|
||||
if(!head_idx || head_idx < data.range.first)
|
||||
return;
|
||||
|
||||
// Generate individual stats for this room's sync
|
||||
#ifdef RB_DEBUG
|
||||
assert(head_idx); // room should exist
|
||||
sync::stats *const statsp
|
||||
{
|
||||
head_idx >= data.range.first?
|
||||
data.stats:
|
||||
nullptr
|
||||
};
|
||||
|
||||
const scope_restore<decltype(data.stats)> statsp_
|
||||
{
|
||||
data.stats, statsp
|
||||
};
|
||||
|
||||
sync::stats stats
|
||||
{
|
||||
data.stats?
|
||||
|
@ -119,7 +128,7 @@ ircd::m::sync::_rooms_polylog(data &data,
|
|||
|
||||
#ifdef RB_DEBUG
|
||||
thread_local char tmbuf[32];
|
||||
log::debug
|
||||
if(data.stats) log::debug
|
||||
{
|
||||
log, "polylog %s %s in %s",
|
||||
loghead(data),
|
||||
|
|
|
@ -60,7 +60,7 @@ ircd::m::sync::room_ephemeral_m_receipt_m_read_polylog(data &data)
|
|||
}
|
||||
};
|
||||
|
||||
members.for_each(data.membership, m::room::members::closure{[¶llel, &q, &buf]
|
||||
members.for_each(m::room::members::closure{[¶llel, &q, &buf]
|
||||
(const m::user::id &user_id)
|
||||
{
|
||||
const auto pos(parallel.nextpos());
|
||||
|
|
|
@ -83,6 +83,14 @@ ircd::m::sync::room_state_polylog(data &data)
|
|||
data.out
|
||||
};
|
||||
|
||||
const auto head_idx
|
||||
{
|
||||
m::head_idx(std::nothrow, *data.room)
|
||||
};
|
||||
|
||||
if(head_idx < data.range.first)
|
||||
return;
|
||||
|
||||
room_state_polylog_events(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -104,6 +104,14 @@ ircd::m::sync::room_timeline_polylog(data &data)
|
|||
data.out
|
||||
};
|
||||
|
||||
const auto head_idx
|
||||
{
|
||||
m::head_idx(std::nothrow, *data.room)
|
||||
};
|
||||
|
||||
if(head_idx < data.range.first)
|
||||
return;
|
||||
|
||||
// events
|
||||
bool limited{false};
|
||||
m::event::id::buf prev
|
||||
|
|
Loading…
Reference in a new issue