mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
more logging for device messages
This commit is contained in:
parent
c5c0a181ff
commit
08622699f6
@ -37,6 +37,9 @@ export class DeviceMessageHandler {
|
||||
async writeSync(toDeviceEvents, txn, log) {
|
||||
const encryptedEvents = toDeviceEvents.filter(e => e.type === "m.room.encrypted");
|
||||
log.set("encryptedCount", encryptedEvents.length);
|
||||
const keyRequestCount = toDeviceEvents.reduce((sum, e) => sum + e.type === "m.room_key_request" ? 1 : 0, 0);
|
||||
log.set("keyRequestCount", keyRequestCount);
|
||||
log.set("otherCount", toDeviceEvents.length - encryptedEvents.length - keyRequestCount);
|
||||
if (!encryptedEvents.length) {
|
||||
return false;
|
||||
}
|
||||
|
@ -399,7 +399,7 @@ export class Session {
|
||||
}
|
||||
|
||||
const toDeviceEvents = syncResponse.to_device?.events;
|
||||
if (Array.isArray(toDeviceEvents)) {
|
||||
if (Array.isArray(toDeviceEvents) && toDeviceEvents.length) {
|
||||
changes.deviceMessageDecryptionPending =
|
||||
await log.wrap("deviceMsgs", log => this._deviceMessageHandler.writeSync(toDeviceEvents, txn, log));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user