aunubaileys 1.0.15 → 1.0.16

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 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.16 / Baru di 1.0.16
68
+
69
+ - 🪪 **Identity changes are handled, not just logged** — when WhatsApp notifies that a contact's identity changed (new phone / reinstall / recycled number), upstream Baileys logs “identity changed” and does nothing, leaving your stored session bound to the old identity so that contact's messages keep failing. AunuBaileys now deletes the stored session for that JID on the spot, so the next exchange re-initiates cleanly against the new identity.
70
+
67
71
  ### 🆕 What's new in 1.0.15 / Baru di 1.0.15
68
72
 
69
73
  - 📤 **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).
@@ -176,8 +176,19 @@ export const makeMessagesRecvSocket = (config) => {
176
176
  const identityNode = getBinaryNodeChild(node, 'identity');
177
177
  if (identityNode) {
178
178
  logger.info({ jid: from }, 'identity changed');
179
- // not handling right now
180
- // signal will override new identity anyway
179
+ // AunuBaileys: upstream logged this and did nothing, leaving the
180
+ // OLD session bound to the OLD identity — every later message from
181
+ // that contact then fails against the archived session (Bad MAC
182
+ // class) until the peer happens to send a pre-key message. Drop
183
+ // the stored session now (1.0.14 machinery) so the next exchange
184
+ // re-initiates cleanly against the new identity.
185
+ try {
186
+ await signalRepository.deleteSession(from);
187
+ logger.warn({ jid: from }, 'aunu: deleted stored session after identity change; next message re-initiates a fresh session');
188
+ }
189
+ catch (delErr) {
190
+ logger.debug({ err: delErr }, 'aunu: session delete on identity change failed');
191
+ }
181
192
  }
182
193
  else {
183
194
  logger.info({ node }, 'unknown encrypt notification');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aunubaileys",
3
3
  "type": "module",
4
- "version": "1.0.15",
4
+ "version": "1.0.16",
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",