aunubaileys 1.0.14 → 1.0.15
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 +4 -0
- package/lib/Socket/messages-send.js +17 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,6 +64,10 @@ Everything else is pure upstream. When upstream moves, we rebase the patch layer
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
+
### 🆕 What's new in 1.0.15 / Baru di 1.0.15
|
|
68
|
+
|
|
69
|
+
- 📤 **Send-side session heal** — the twin of 1.0.14 for outgoing messages: when the stored session for a JID is corrupt, `encryptMessage` throws and every send to that contact fails permanently. Now a session-flavoured encrypt error triggers an automatic heal — drop the session, fetch a fresh bundle from the server, encrypt once more. Non-session errors pass through untouched, and a second failure propagates (no retry loop).
|
|
70
|
+
|
|
67
71
|
### 🆕 What's new in 1.0.14 / Baru di 1.0.14
|
|
68
72
|
|
|
69
73
|
- 💊 **Bad MAC self-heal** — when a contact's E2E session rots (classic after re-pairing: every message from that one contact fails with “Bad MAC” forever), upstream Baileys just retries against the same stale session endlessly. AunuBaileys now counts consecutive decrypt failures per identity; at the 3rd, it **deletes the stale session** (new `signalRepository.deleteSession`) and forces the next retry receipt to carry fresh keys, so the peer re-initiates a clean session — the same reset dance official clients use. A successful decrypt zeroes the counter. Groups are excluded (sender-key class, handled separately).
|
|
@@ -229,7 +229,23 @@ export const makeMessagesSocket = (config) => {
|
|
|
229
229
|
return {};
|
|
230
230
|
}
|
|
231
231
|
const bytes = encodeWAMessage(patchedMessage);
|
|
232
|
-
|
|
232
|
+
let encResult;
|
|
233
|
+
try {
|
|
234
|
+
encResult = await signalRepository.encryptMessage({ jid, data: bytes });
|
|
235
|
+
}
|
|
236
|
+
catch (encErr) {
|
|
237
|
+
// AunuBaileys: a corrupt/rotten stored session makes EVERY send to
|
|
238
|
+
// this JID fail at encrypt time, forever. Heal it the Signal way:
|
|
239
|
+
// drop the session, fetch a fresh bundle, encrypt once more.
|
|
240
|
+
if (!/session/i.test(String(encErr?.message || encErr))) {
|
|
241
|
+
throw encErr;
|
|
242
|
+
}
|
|
243
|
+
logger.warn({ jid, err: encErr?.message }, 'aunu: encrypt failed on a stale session; refreshing the session and retrying once');
|
|
244
|
+
await signalRepository.deleteSession(jid);
|
|
245
|
+
await assertSessions([jid], true);
|
|
246
|
+
encResult = await signalRepository.encryptMessage({ jid, data: bytes });
|
|
247
|
+
}
|
|
248
|
+
const { type, ciphertext } = encResult;
|
|
233
249
|
if (type === 'pkmsg') {
|
|
234
250
|
shouldIncludeDeviceIdentity = true;
|
|
235
251
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aunubaileys",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.15",
|
|
5
5
|
"description": "AunuBaileys \u2014 a WhatsApp Web API for bots that never sleep. Full upstream power with the beloved in-memory store restored and pairing that just works. Forged by AunuCore.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"whatsapp",
|