mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd:Ⓜ️:sync: Fix phased polylog invocation conditions; eliminate initial flag. (#105)
This commit is contained in:
parent
fc742ae2d0
commit
100f5c646a
9 changed files with 8 additions and 47 deletions
|
@ -52,7 +52,6 @@ struct ircd::m::sync::item
|
|||
json::strung feature;
|
||||
json::object opts;
|
||||
bool phased;
|
||||
bool initial;
|
||||
|
||||
public:
|
||||
string_view name() const;
|
||||
|
|
15
ircd/m.cc
15
ircd/m.cc
|
@ -617,8 +617,8 @@ bool
|
|||
ircd::m::sync::apropos(const data &d,
|
||||
const event::idx &event_idx)
|
||||
{
|
||||
return event_idx >= d.range.first &&
|
||||
event_idx < d.range.second;
|
||||
return d.phased ||
|
||||
(event_idx >= d.range.first && event_idx < d.range.second);
|
||||
}
|
||||
|
||||
ircd::string_view
|
||||
|
@ -724,10 +724,6 @@ ircd::m::sync::item::item(std::string name,
|
|||
{
|
||||
opts.get<bool>("phased", false)
|
||||
}
|
||||
,initial
|
||||
{
|
||||
opts.get<bool>("initial", false)
|
||||
}
|
||||
{
|
||||
log::debug
|
||||
{
|
||||
|
@ -757,12 +753,7 @@ try
|
|||
if(!enable)
|
||||
return false;
|
||||
|
||||
// Skip the item for phased-sync ranges after initial sync if it has initial=true
|
||||
if(data.phased && initial && int64_t(data.range.first) < 0L)
|
||||
return false;
|
||||
|
||||
// Skip the item for phased-sync ranges if it's not phased-sync aware.
|
||||
if(data.phased && !phased && int64_t(data.range.first) < 0L)
|
||||
if(data.phased && !phased && int64_t(data.range.first) < 0)
|
||||
return false;
|
||||
|
||||
#ifdef RB_DEBUG
|
||||
|
|
|
@ -29,9 +29,6 @@ ircd::m::sync::account_data
|
|||
"account_data",
|
||||
account_data_polylog,
|
||||
account_data_linear,
|
||||
{
|
||||
{ "initial", true }
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
|
|
|
@ -181,19 +181,7 @@ ircd::m::sync::_rooms_polylog(data &data,
|
|||
stats.timer = timer{};
|
||||
#endif
|
||||
|
||||
{
|
||||
const scope_restore phased
|
||||
{
|
||||
data.phased, int64_t(data.range.first) < 0? false : data.phased
|
||||
};
|
||||
|
||||
const scope_restore range
|
||||
{
|
||||
data.range.first, phased.theirs? 0UL : data.range.first
|
||||
};
|
||||
|
||||
ret |= _rooms_polylog_room(data, room);
|
||||
}
|
||||
|
||||
#if defined(RB_DEBUG)
|
||||
thread_local char tmbuf[32];
|
||||
|
|
|
@ -34,9 +34,6 @@ ircd::m::sync::room_account_data
|
|||
"rooms.account_data",
|
||||
room_account_data_polylog,
|
||||
room_account_data_linear,
|
||||
{
|
||||
{ "initial", true }
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
|
@ -204,9 +201,7 @@ ircd::m::sync::room_account_data_polylog(data &data)
|
|||
};
|
||||
|
||||
bool ret{false};
|
||||
if(!data.phased || int64_t(data.range.first) > 0L)
|
||||
ret |= room_account_data_polylog_events(data);
|
||||
|
||||
ret |= room_account_data_polylog_tags(data);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -227,8 +227,8 @@ ircd::m::sync::_room_state_polylog(data &data)
|
|||
{
|
||||
assert(data.args);
|
||||
if(likely(!data.args->full_state))
|
||||
if(!data.phased && int64_t(data.range.first) > 0)
|
||||
if(!apropos(data, data.room_head))
|
||||
if(!data.phased || int64_t(data.range.first) > 0)
|
||||
return false;
|
||||
|
||||
return room_state_polylog_events(data);
|
||||
|
|
|
@ -30,9 +30,6 @@ ircd::m::sync::room_summary
|
|||
"rooms.summary",
|
||||
room_summary_polylog,
|
||||
room_summary_linear,
|
||||
{
|
||||
{ "initial", true },
|
||||
}
|
||||
};
|
||||
|
||||
bool
|
||||
|
|
|
@ -36,10 +36,7 @@ ircd::m::sync::room_timeline
|
|||
{
|
||||
"rooms.timeline",
|
||||
room_timeline_polylog,
|
||||
room_timeline_linear,
|
||||
{
|
||||
{ "initial", true },
|
||||
}
|
||||
room_timeline_linear
|
||||
};
|
||||
|
||||
decltype(ircd::m::sync::limit_default)
|
||||
|
|
|
@ -31,9 +31,6 @@ ircd::m::sync::room_unread_notifications
|
|||
"rooms.unread_notifications",
|
||||
room_unread_notifications_polylog,
|
||||
room_unread_notifications_linear,
|
||||
{
|
||||
{ "initial", true },
|
||||
}
|
||||
};
|
||||
|
||||
decltype(ircd::m::sync::exposure_depth)
|
||||
|
|
Loading…
Reference in a new issue