messages-recv: remove old message retry system, new one handles fine
This commit is contained in:
@@ -34,7 +34,6 @@ import {
|
|||||||
hkdf,
|
hkdf,
|
||||||
MISSING_KEYS_ERROR_TEXT,
|
MISSING_KEYS_ERROR_TEXT,
|
||||||
NACK_REASONS,
|
NACK_REASONS,
|
||||||
NO_MESSAGE_FOUND_ERROR_TEXT,
|
|
||||||
unixTimestampSeconds,
|
unixTimestampSeconds,
|
||||||
xmppPreKey,
|
xmppPreKey,
|
||||||
xmppSignedPreKey
|
xmppSignedPreKey
|
||||||
@@ -1115,23 +1114,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
return
|
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 {
|
const {
|
||||||
fullMessage: msg,
|
fullMessage: msg,
|
||||||
category,
|
category,
|
||||||
@@ -1139,10 +1121,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
decrypt
|
decrypt
|
||||||
} = decryptMessageNode(node, authState.creds.me!.id, authState.creds.me!.lid || '', signalRepository, logger)
|
} = 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 (
|
if (
|
||||||
msg.message?.protocolMessage?.type === proto.Message.ProtocolMessage.Type.SHARE_PHONE_NUMBER &&
|
msg.message?.protocolMessage?.type === proto.Message.ProtocolMessage.Type.SHARE_PHONE_NUMBER &&
|
||||||
node.attrs.sender_pn
|
node.attrs.sender_pn
|
||||||
@@ -1206,11 +1184,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getBinaryNodeChild(node, 'unavailable')) {
|
|
||||||
logger.debug('Message unavailable, skipping retry')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle pre-key errors with upload and delay
|
// Handle pre-key errors with upload and delay
|
||||||
if (isPreKeyError) {
|
if (isPreKeyError) {
|
||||||
logger.info({ error: errorMessage }, 'PreKey error detected, uploading and retrying')
|
logger.info({ error: errorMessage }, 'PreKey error detected, uploading and retrying')
|
||||||
|
|||||||
Reference in New Issue
Block a user