aunubaileys 1.0.31 → 1.0.33
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 +8 -0
- package/lib/Socket/chats.js +17 -1
- package/lib/Socket/socket.js +9 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,6 +64,14 @@ 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.33 / Baru di 1.0.33
|
|
68
|
+
|
|
69
|
+
- 💓 **One lost keep-alive pong no longer kills the connection** — upstream ended the connection as soon as the gap since last inbound traffic exceeded one interval + 5s; on a quiet connection the ping response is the only inbound traffic, so a single lost pong killed a healthy connection and forced a full reconnect. The connection is now ended only after two consecutive intervals without a reply; genuinely dead connections are still detected, one interval later.
|
|
70
|
+
|
|
71
|
+
### 🆕 What's new in 1.0.32 / Baru di 1.0.32
|
|
72
|
+
|
|
73
|
+
- 👥 **Group senders that arrive LID-only are now identifiable by phone number** — in groups, `key.participant` is increasingly a LID while `participantPn` is only sometimes included by the server, leaving phone-number-based sender identification blind. When the LID store knows the pair, the missing `participantPn` / `participantLid` is now filled in on the upsert path before the event reaches consumers. `key.participant` itself is NEVER rewritten — it is the E2E addressing identity the session/sender-key state is keyed by.
|
|
74
|
+
|
|
67
75
|
### 🆕 What's new in 1.0.31 / Baru di 1.0.31
|
|
68
76
|
|
|
69
77
|
- 📜 **History-sync record list no longer grows without bound in creds** — every history-sync notification appended an entry to `creds.processedHistoryMessages`, yet nothing anywhere reads those entries (the single read is an emptiness check for `isLatest`). The list lives in creds, so each entry bloated creds.json and was spread-copied and re-serialized on every save for the life of the account. Only the most recent 50 entries are now kept; `isLatest` semantics are unchanged.
|
package/lib/Socket/chats.js
CHANGED
|
@@ -7,7 +7,7 @@ import { SyncState } from '../Types/State.js';
|
|
|
7
7
|
import { chatModificationToAppPatch, decodePatches, decodeSyncdSnapshot, encodeSyncdPatch, extractSyncdPatches, generateProfilePicture, getHistoryMsg, newLTHashState, processSyncAction } from '../Utils/index.js';
|
|
8
8
|
import { makeMutex } from '../Utils/make-mutex.js';
|
|
9
9
|
import processMessage from '../Utils/process-message.js';
|
|
10
|
-
import { getBinaryNodeChild, getBinaryNodeChildren, jidDecode, jidNormalizedUser, reduceBinaryNodeToDictionary, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
10
|
+
import { getBinaryNodeChild, getBinaryNodeChildren, isJidUser, isLidUser, jidDecode, jidNormalizedUser, reduceBinaryNodeToDictionary, S_WHATSAPP_NET } from '../WABinary/index.js';
|
|
11
11
|
import { USyncQuery, USyncUser } from '../WAUSync/index.js';
|
|
12
12
|
import { makeUSyncSocket } from './usync.js';
|
|
13
13
|
const MAX_SYNC_ATTEMPTS = 2;
|
|
@@ -794,6 +794,22 @@ export const makeChatsSocket = (config) => {
|
|
|
794
794
|
await Promise.all([fetchProps(), fetchBlocklist(), fetchPrivacySettings()]);
|
|
795
795
|
};
|
|
796
796
|
const upsertMessage = ev.createBufferedFunction(async (msg, type) => {
|
|
797
|
+
// AunuBaileys: fill the alternate identity forms on the key from
|
|
798
|
+
// the LID store when the stanza did not carry them. Consumers
|
|
799
|
+
// identifying group senders by phone number read participantPn,
|
|
800
|
+
// which the server only sometimes includes; without it a
|
|
801
|
+
// LID-addressed participant is unidentifiable to them.
|
|
802
|
+
// key.participant itself is NEVER rewritten — it is the E2E
|
|
803
|
+
// addressing identity the session/sender-key state is keyed by.
|
|
804
|
+
const aunuKey = msg?.key;
|
|
805
|
+
if (aunuKey?.participant && sock.aunuLid) {
|
|
806
|
+
if (!aunuKey.participantPn && isLidUser(aunuKey.participant)) {
|
|
807
|
+
aunuKey.participantPn = sock.aunuLid.getPNForLID(aunuKey.participant) || aunuKey.participantPn;
|
|
808
|
+
}
|
|
809
|
+
if (!aunuKey.participantLid && isJidUser(aunuKey.participant)) {
|
|
810
|
+
aunuKey.participantLid = sock.aunuLid.getLIDForPN(aunuKey.participant) || aunuKey.participantLid;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
797
813
|
ev.emit('messages.upsert', { messages: [msg], type });
|
|
798
814
|
if (!!msg.pushName) {
|
|
799
815
|
let jid = msg.key.fromMe ? authState.creds.me.id : msg.key.participant || msg.key.remoteJid;
|
package/lib/Socket/socket.js
CHANGED
|
@@ -316,7 +316,15 @@ export const makeSocket = (config) => {
|
|
|
316
316
|
check if it's been a suspicious amount of time since the server responded with our last seen
|
|
317
317
|
it could be that the network is down
|
|
318
318
|
*/
|
|
319
|
-
|
|
319
|
+
// AunuBaileys: tolerate up to two missed keep-alive intervals
|
|
320
|
+
// before declaring the connection lost. Upstream ended it after
|
|
321
|
+
// a single unanswered ping (> interval + 5s): on a quiet
|
|
322
|
+
// connection the ping response is the only inbound traffic, so
|
|
323
|
+
// one lost pong killed a healthy connection and forced a full
|
|
324
|
+
// reconnect (with its pairing and message-loss windows). Two
|
|
325
|
+
// consecutive misses still end it; genuinely dead connections
|
|
326
|
+
// are detected ~one interval later than before.
|
|
327
|
+
if (diff > 2 * keepAliveIntervalMs + 5000) {
|
|
320
328
|
end(new Boom('Connection was lost', { statusCode: DisconnectReason.connectionLost }));
|
|
321
329
|
}
|
|
322
330
|
else if (ws.isOpen) {
|
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.33",
|
|
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",
|