messages-recv: remove old message retry system, new one handles fine

This commit is contained in:
Rajeh Taher
2025-09-25 23:25:10 +03:00
parent f6e1bb6150
commit 39d2ac004a
-27
View File
@@ -34,7 +34,6 @@ import {
hkdf,
MISSING_KEYS_ERROR_TEXT,
NACK_REASONS,
NO_MESSAGE_FOUND_ERROR_TEXT,
unixTimestampSeconds,
xmppPreKey,
xmppSignedPreKey
@@ -1115,23 +1114,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
return
}
let response: string | undefined
if (getBinaryNodeChild(node, 'unavailable') && !encNode) {
await sendMessageAck(node)
const { key } = decodeMessageNode(node, authState.creds.me!.id, authState.creds.me!.lid || '').fullMessage
response = await requestPlaceholderResend(key) // TODO: DEPRECATE THIS LOGIC AND PASS IT OFF TO THE RETRY MANAGER
if (response === 'RESOLVED') {
return
}
logger.debug('received unavailable message, acked and requested resend from phone')
} else {
if (await placeholderResendCache.get(node.attrs.id!)) {
await placeholderResendCache.del(node.attrs.id!)
}
}
const {
fullMessage: msg,
category,
@@ -1139,10 +1121,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
decrypt
} = decryptMessageNode(node, authState.creds.me!.id, authState.creds.me!.lid || '', signalRepository, logger)
if (response && msg?.messageStubParameters?.[0] === NO_MESSAGE_FOUND_ERROR_TEXT) {
msg.messageStubParameters = [NO_MESSAGE_FOUND_ERROR_TEXT, response]
}
if (
msg.message?.protocolMessage?.type === proto.Message.ProtocolMessage.Type.SHARE_PHONE_NUMBER &&
node.attrs.sender_pn
@@ -1206,11 +1184,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
return
}
if (getBinaryNodeChild(node, 'unavailable')) {
logger.debug('Message unavailable, skipping retry')
return
}
// Handle pre-key errors with upload and delay
if (isPreKeyError) {
logger.info({ error: errorMessage }, 'PreKey error detected, uploading and retrying')