fix: gracefully handle unavailable view-once messages and improve log error (#2070)

This commit is contained in:
João Lucas de Oliveira Lopes
2025-11-19 10:12:28 -03:00
committed by GitHub
parent abf5af0e72
commit e5f820d119
2 changed files with 14 additions and 2 deletions
+10
View File
@@ -1143,6 +1143,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}
const encNode = getBinaryNodeChild(node, 'enc')
const unavailableNode = getBinaryNodeChild(node, 'unavailable')
// TODO: temporary fix for crashes and issues resulting of failed msmsg decryption
if (encNode && encNode.attrs.type === 'msmsg') {
@@ -1151,6 +1152,15 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
return
}
if (unavailableNode) {
logger.warn(
{ id: node.attrs.id, from: node.attrs.from, type: unavailableNode.attrs?.type },
'received unavailable message, sending positive ack'
)
await sendMessageAck(node)
return
}
const {
fullMessage: msg,
category,