chore: log fallback mapping availability

This commit is contained in:
Renato Alcara
2026-01-21 00:52:17 -03:00
parent 34ab791dc0
commit 31fdfa8b7c
4 changed files with 250 additions and 91 deletions
+11 -1
View File
@@ -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')
}
+2
View File
@@ -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')