Logging improvements for sessions

This commit is contained in:
Scott Nonnenberg
2025-04-23 02:18:14 +10:00
committed by GitHub
parent bd53f2891e
commit c530192236
4 changed files with 1 additions and 25 deletions

View File

@@ -249,8 +249,6 @@ export class SignalProtocolStore extends EventEmitter {
sessionQueues = new Map<SessionIdType, PQueue>();
sessionQueueJobCounter = 0;
readonly #identityQueues = new Map<ServiceIdString, PQueue>();
#currentZone?: Zone;
#currentZoneDepth = 0;
@@ -991,29 +989,13 @@ export class SignalProtocolStore extends EventEmitter {
async enqueueSessionJob<T>(
qualifiedAddress: QualifiedAddress,
name: string,
task: () => Promise<T>,
zone: Zone = GLOBAL_ZONE
): Promise<T> {
this.sessionQueueJobCounter += 1;
const id = this.sessionQueueJobCounter;
const waitStart = Date.now();
return this.withZone(zone, 'enqueueSessionJob', async () => {
const queue = this.#_getSessionQueue(qualifiedAddress);
const waitTime = Date.now() - waitStart;
log.info(
`enqueueSessionJob(${id}): queuing task ${name}, waited ${waitTime}ms`
);
const queueStart = Date.now();
return queue.add<T>(() => {
const queueTime = Date.now() - queueStart;
log.info(
`enqueueSessionJob(${id}): running task ${name}, waited ${queueTime}ms`
);
return task();
});
});
@@ -1593,7 +1575,6 @@ export class SignalProtocolStore extends EventEmitter {
await this.enqueueSessionJob(
addr,
`_archiveSession(${addr.toString()})`,
async () => {
const item = entry.hydrated ? entry.item : hydrateSession(entry.fromDB);

View File

@@ -1798,7 +1798,6 @@ export default class MessageReceiver
);
const unsealedPlaintext = await this.#storage.protocol.enqueueSessionJob(
address,
`sealedSenderDecryptMessage(${address.toString()})`,
() =>
sealedSenderDecryptMessage(
Buffer.from(ciphertext),
@@ -1893,7 +1892,6 @@ export default class MessageReceiver
const plaintext = await this.#storage.protocol.enqueueSessionJob(
address,
`signalDecrypt(${address.toString()})`,
async () =>
this.#unpad(
await signalDecrypt(
@@ -1925,7 +1923,6 @@ export default class MessageReceiver
const plaintext = await this.#storage.protocol.enqueueSessionJob(
address,
`signalDecryptPreKey(${address.toString()})`,
async () =>
this.#unpad(
await signalDecryptPreKey(

View File

@@ -445,7 +445,6 @@ export default class OutgoingMessage {
return window.textsecure.storage.protocol.enqueueSessionJob<MessageType>(
address,
`doSendMessage(${address.toString()}, ${this.timestamp})`,
async () => {
const protocolAddress = ProtocolAddress.new(
serviceId,
@@ -641,7 +640,7 @@ export default class OutgoingMessage {
) {
newError = new OutgoingIdentityKeyError(serviceId, error);
log.error(
'Got "key changed" error from encrypt - no identityKey for application layer',
'UntrustedIdentityKeyError from decrypt!',
serviceId,
deviceIds
);

View File

@@ -183,7 +183,6 @@ async function handleServerKeys(
try {
await window.textsecure.storage.protocol.enqueueSessionJob(
address,
`handleServerKeys(${serviceId})`,
() =>
processPreKeyBundle(
preKeyBundle,