0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 00:14:07 +01:00

modules/client/sync/rooms: Don't skip sync routines based on room head index.

This commit is contained in:
Jason Volk 2019-01-25 16:18:21 -08:00
parent 3e9b830206
commit 05f39b03d6
4 changed files with 32 additions and 7 deletions

View file

@ -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),

View file

@ -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{[&parallel, &q, &buf]
members.for_each(m::room::members::closure{[&parallel, &q, &buf]
(const m::user::id &user_id)
{
const auto pos(parallel.nextpos());

View file

@ -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);
}

View file

@ -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