mirror of
https://github.com/matrix-construct/construct
synced 2024-09-29 04:08:54 +02:00
modules/client/sync: Use real exception handler; fix polylog call; fix presence key; unlocker.
This commit is contained in:
parent
f79000b18d
commit
163fc25790
1 changed files with 16 additions and 14 deletions
|
@ -343,7 +343,6 @@ try
|
||||||
m::vm::accept.wait_until(lock, args.timesout)
|
m::vm::accept.wait_until(lock, args.timesout)
|
||||||
};
|
};
|
||||||
|
|
||||||
const unlock_guard<decltype(lock)> ul(lock);
|
|
||||||
if(synchronize(client, request, args, accepted))
|
if(synchronize(client, request, args, accepted))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -546,7 +545,7 @@ update_sync(client &client,
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<json::value> presents;
|
std::vector<json::value> presents;
|
||||||
ur.get(std::nothrow, "m.presence", [&]
|
ur.get(std::nothrow, "ircd.presence", [&]
|
||||||
(const m::event &event)
|
(const m::event &event)
|
||||||
{
|
{
|
||||||
const auto &content
|
const auto &content
|
||||||
|
@ -595,18 +594,8 @@ polylog_sync(client &client,
|
||||||
const resource::request &request,
|
const resource::request &request,
|
||||||
shortpoll &sp,
|
shortpoll &sp,
|
||||||
json::stack::object &object)
|
json::stack::object &object)
|
||||||
|
try
|
||||||
{
|
{
|
||||||
const unwind::exceptional uw{[&sp]
|
|
||||||
{
|
|
||||||
log::error
|
|
||||||
{
|
|
||||||
"polylog sync ERROR %lu to %lu (vm @ %zu)"
|
|
||||||
,sp.since
|
|
||||||
,sp.current
|
|
||||||
,m::vm::current_sequence
|
|
||||||
};
|
|
||||||
}};
|
|
||||||
|
|
||||||
{
|
{
|
||||||
json::stack::member member{object, "rooms"};
|
json::stack::member member{object, "rooms"};
|
||||||
json::stack::object object{member};
|
json::stack::object object{member};
|
||||||
|
@ -634,6 +623,19 @@ polylog_sync(client &client,
|
||||||
|
|
||||||
return sp.committed;
|
return sp.committed;
|
||||||
}
|
}
|
||||||
|
catch(const std::exception &e)
|
||||||
|
{
|
||||||
|
log::error
|
||||||
|
{
|
||||||
|
"polylog sync ERROR %lu to %lu (vm @ %zu) :%s"
|
||||||
|
,sp.since
|
||||||
|
,sp.current
|
||||||
|
,m::vm::current_sequence
|
||||||
|
,e.what()
|
||||||
|
};
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
polylog_sync_presence(shortpoll &sp,
|
polylog_sync_presence(shortpoll &sp,
|
||||||
|
@ -842,7 +844,7 @@ polylog_sync_room(shortpoll &sp,
|
||||||
{
|
{
|
||||||
json::stack::member member{out, "account_data"};
|
json::stack::member member{out, "account_data"};
|
||||||
json::stack::object object{member};
|
json::stack::object object{member};
|
||||||
polylog_sync_room_ephemeral(sp, object, room);
|
polylog_sync_room_account_data(sp, object, room);
|
||||||
}
|
}
|
||||||
|
|
||||||
// unread_notifications
|
// unread_notifications
|
||||||
|
|
Loading…
Reference in a new issue