fix: gracefully handle unavailable view-once messages and improve log error (#2070)
This commit is contained in:
committed by
GitHub
parent
abf5af0e72
commit
e5f820d119
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user