chore: reduce logging

This commit is contained in:
Adhiraj Singh
2022-09-28 10:40:29 +05:30
parent f01f5df4f5
commit bb983cd30d
2 changed files with 8 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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'
)
}
)