@realvare/based 2.5.7 → 2.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +1288 -1544
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Socket/messages-recv.js +0 -29
- package/lib/Socket/messages-send.js +1406 -1410
- package/lib/Socket/socket.js +1 -1
- package/lib/Types/Message.d.ts +413 -413
- package/lib/Utils/cache-manager.js +1 -16
- package/lib/Utils/messages.js +1338 -1373
- package/lib/Utils/performance-config.d.ts +0 -4
- package/lib/Utils/performance-config.js +4 -8
- package/package.json +6 -3
- package/lib/Utils/rate-limiter.js +0 -95
|
@@ -640,25 +640,12 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
else {
|
|
643
|
-
// Log ACK status changes for monitoring
|
|
644
|
-
ids.forEach(id => {
|
|
645
|
-
const statusName = Object.keys(WAProto_1.proto.WebMessageInfo.Status)[status] || `UNKNOWN_${status}`;
|
|
646
|
-
logger.debug({ remoteJid, id, status: statusName }, 'ACK status update');
|
|
647
|
-
});
|
|
648
643
|
ev.emit('messages.update', ids.map(id => ({
|
|
649
644
|
key: { ...key, id },
|
|
650
645
|
update: { status }
|
|
651
646
|
})));
|
|
652
647
|
}
|
|
653
648
|
}
|
|
654
|
-
// Emit SERVER_ACK for error status to fix stuck ACKs
|
|
655
|
-
if (status === WAProto_1.proto.WebMessageInfo.Status.ERROR) {
|
|
656
|
-
ev.emit('messages.update', ids.map(id => ({
|
|
657
|
-
key: { ...key, id },
|
|
658
|
-
update: { status: WAProto_1.proto.WebMessageInfo.Status.SERVER_ACK }
|
|
659
|
-
})));
|
|
660
|
-
}
|
|
661
|
-
|
|
662
649
|
if (attrs.type === 'retry') {
|
|
663
650
|
// correctly set who is asking for the retry
|
|
664
651
|
key.participant = key.participant || attrs.from;
|
|
@@ -1054,22 +1041,6 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
1054
1041
|
logger.trace(`sendActiveReceipts set to "${sendActiveReceipts}"`);
|
|
1055
1042
|
}
|
|
1056
1043
|
});
|
|
1057
|
-
|
|
1058
|
-
// Retry logic for stuck pending messages
|
|
1059
|
-
ev.on('messages.update', (updates) => {
|
|
1060
|
-
updates.forEach(update => {
|
|
1061
|
-
if (update.update.status === WAProto_1.proto.WebMessageInfo.Status.PENDING &&
|
|
1062
|
-
Date.now() - (update.update.timestamp || 0) > 30000) { // 30 seconds
|
|
1063
|
-
logger.debug({ key: update.key }, 'retrying stuck pending message');
|
|
1064
|
-
// Retry by re-sending the message
|
|
1065
|
-
getMessage(update.key).then(msg => {
|
|
1066
|
-
if (msg) {
|
|
1067
|
-
relayMessage(update.key.remoteJid, msg, { messageId: update.key.id });
|
|
1068
|
-
}
|
|
1069
|
-
}).catch(err => logger.error({ err, key: update.key }, 'failed to retry stuck message'));
|
|
1070
|
-
}
|
|
1071
|
-
});
|
|
1072
|
-
});
|
|
1073
1044
|
return {
|
|
1074
1045
|
...sock,
|
|
1075
1046
|
sendMessageAck,
|