From bb983cd30d8aecd3eed4fa782fe6e60e6ee238c8 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Wed, 28 Sep 2022 10:40:29 +0530 Subject: [PATCH] chore: reduce logging --- src/Utils/chat-utils.ts | 2 +- src/Utils/process-message.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Utils/chat-utils.ts b/src/Utils/chat-utils.ts index 3677bbc..a243789 100644 --- a/src/Utils/chat-utils.ts +++ b/src/Utils/chat-utils.ts @@ -724,7 +724,7 @@ export const processSyncAction = ( ev.emit('chats.delete', [id]) } } else { - logger?.warn({ syncAction, id }, 'unprocessable update') + logger?.debug({ syncAction, id }, 'unprocessable update') } function isValidPatchBasedOnMessageRange(id: string, msgRange: proto.SyncActionValue.ISyncActionMessageRange | null | undefined) { diff --git a/src/Utils/process-message.ts b/src/Utils/process-message.ts index 89a9f43..5202230 100644 --- a/src/Utils/process-message.ts +++ b/src/Utils/process-message.ts @@ -133,14 +133,20 @@ const processMessage = async( let newAppStateSyncKeyId = '' await keyStore.transaction( async() => { + const newKeys: string[] = [] for(const { keyData, keyId } of keys) { const strKeyId = Buffer.from(keyId!.keyId!).toString('base64') + newKeys.push(strKeyId) - logger?.info({ strKeyId }, 'injecting new app state sync key') await keyStore.set({ 'app-state-sync-key': { [strKeyId]: keyData! } }) newAppStateSyncKeyId = strKeyId } + + logger?.info( + { newAppStateSyncKeyId, newKeys }, + 'injecting new app state sync keys' + ) } )