chore: log fallback mapping availability
This commit is contained in:
+11
-1
@@ -1187,7 +1187,17 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
|
||||
ev.on('lid-mapping.update', async ({ lid, pn }) => {
|
||||
try {
|
||||
await signalRepository.lidMapping.storeLIDPNMappings([{ lid, pn }])
|
||||
const result = await signalRepository.lidMapping.storeLIDPNMappings([{ lid, pn }])
|
||||
logger.debug(
|
||||
{ lid, pn, stored: result.stored, skipped: result.skipped, errors: result.errors },
|
||||
'stored LID-PN mapping from update event'
|
||||
)
|
||||
if (result.stored > 0) {
|
||||
logger.info(
|
||||
{ lid, pn },
|
||||
'fallback LID mapping is now available from update event'
|
||||
)
|
||||
}
|
||||
} catch (error) {
|
||||
logger.warn({ lid, pn, error }, 'Failed to store LID-PN mapping')
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
aesDecryptCTR,
|
||||
aesEncryptGCM,
|
||||
cleanMessage,
|
||||
normalizeMessageJids,
|
||||
Curve,
|
||||
decodeMediaRetryNode,
|
||||
decodeMessageNode,
|
||||
@@ -1316,6 +1317,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
}
|
||||
}
|
||||
|
||||
await normalizeMessageJids(msg, signalRepository, logger)
|
||||
cleanMessage(msg, authState.creds.me!.id, authState.creds.me!.lid!)
|
||||
|
||||
await upsertMessage(msg, node.attrs.offline ? 'append' : 'notify')
|
||||
|
||||
Reference in New Issue
Block a user