aunubaileys 1.0.21 → 1.0.22
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/Utils/auth-utils.js +13 -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.22 / Baru di 1.0.22
|
|
68
|
+
|
|
69
|
+
- 🗑️ **Cacheable key store honours deletions** — `makeCacheableSignalKeyStore` cached `null` values verbatim, but null means *deleted*: later gets returned a phantom present-but-null entry, and a value re-created in the store stayed hidden behind the cached null until the 5-minute TTL expired. Deletions now evict the cache entry, so the next get reads the store's authoritative state — which is exactly what makes `deleteSession`/`deleteSenderKey` (1.0.14/1.0.17) behave correctly through the recommended cacheable wiring. Both defects were reproduced before the fix and pass after it.
|
|
70
|
+
|
|
67
71
|
### 🆕 What's new in 1.0.21 / Baru di 1.0.21
|
|
68
72
|
|
|
69
73
|
- 💾 **saveCreds writes are coalesced** — during pairing, `creds.update` fires many times per second and every event used to queue a full atomic creds.json write. Concurrent `saveCreds()` calls now share one in-flight write, and a call landing mid-write schedules exactly one follow-up, so the file always ends with the latest creds — verified: a 30-call burst produced only ~2–3 real writes instead of 30.
|
package/lib/Utils/auth-utils.js
CHANGED
|
@@ -49,7 +49,19 @@ export function makeCacheableSignalKeyStore(store, logger, _cache) {
|
|
|
49
49
|
let keys = 0;
|
|
50
50
|
for (const type in data) {
|
|
51
51
|
for (const id in data[type]) {
|
|
52
|
-
|
|
52
|
+
// AunuBaileys: a null/undefined value is a DELETION. Upstream
|
|
53
|
+
// cached the null itself, so later gets returned a phantom
|
|
54
|
+
// present-but-null entry and — worse — kept shadowing a value
|
|
55
|
+
// re-created in the store until the TTL expired. Evict instead,
|
|
56
|
+
// so the next get reads the store's authoritative state. This
|
|
57
|
+
// is what makes deleteSession/deleteSenderKey (1.0.14/1.0.17)
|
|
58
|
+
// behave correctly through the recommended cacheable wiring.
|
|
59
|
+
if (data[type][id] === null || typeof data[type][id] === 'undefined') {
|
|
60
|
+
cache.del(getUniqueId(type, id));
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
cache.set(getUniqueId(type, id), data[type][id]);
|
|
64
|
+
}
|
|
53
65
|
keys += 1;
|
|
54
66
|
}
|
|
55
67
|
}
|
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.22",
|
|
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",
|