Repository navigation
Releases
v3.0.4
A patch release completing the 3.0.3 maintenance line - the final round of verified fixes from the same audit batch, including:
- Signal store failures inside an atomic pre-key decrypt are separated from decrypt failures end-to-end (
signal/store-failed, plaintext preserved); a pre-key removal is deferred while its session write is failing, so a store flake can never strand a peer - Group setters validate their inputs at the boundary: invalid ephemeral durations and wrong-typed settings are rejected instead of being sent as wrong wire values
- A newsletter vote fails structurally when the port does not acknowledge it instead of issuing a success receipt
- Native URL and copy-code buttons are encoded with their recorded wire shapes
This also brings the 3.0.3 tree (client-payload handshake fix, live WhatsApp Web version resolution, and the rest of the maintenance batch) to the main branch.
See the README's "What's new in 3.0.4" section for the full list.
Published to npm as @aunucore/baileys@3.0.4.
v3.0.2
A maintenance release on top of 3.0.1 - verified defects fixed across the Signal store, session recovery, media upload, group retry receipts and the transport layer, including:
- Signal store save boundaries now reject malformed identity, session, pre-key and sender-key records at the boundary instead of failing later at load
- A session reset after a decrypt failure now builds its recovery bundle before resetting, so a failed bundle build aborts without a destructive reset
- Media upload responses are size-bounded (1 MiB)
- Group retry receipts after a sender-key rotation no longer silently drop non-requesting members
- Deep-scan hardening: media-key derivation, custom upload-host handling, provisional pairing markers across restarts, sender-key migration ranges, the WebSocket inbound size cap (16 MiB) and linear frame reassembly
New surfaces:
- AI rich tag card (
richTagCardcontent kind) with a golden-vector test - History-sync on-demand requests reject unrecorded wire shapes by name instead of silently dropping them
See the README's "What's new in 3.0.2" section for the full list.
Published to npm as @aunucore/baileys@3.0.2.
v3.0.1
AunuBaileys v3 is now the source on main, replacing the 2.x tree. The 2.x source remains available in this repository's history and under the v2.9.0 tag.
What's new in 3.0.1
A fix release on top of 3.0.0 - 25 verified defects fixed across the client, Signal provider, identity/LID handling, media, the migration converter, and domain services, including:
- Group notifications dispatch on the real wire type again, so group events arrive
- Peer bundle signed-pre-key signatures are cryptographically verified before a session is built
- The pairing attempt budget is a persisted 10-minute window (5 attempts), restored across restarts
- Media upload/download failover is bounded, and per-host size limits are honoured
- LID/PN canonicalisation at the decrypt boundary and in retry-receipt lookups
- The migration converter round-trips device sessions correctly - no re-pairing
New surfaces:
- Rich message compiler (text primitives) with a protocol-message edit flow
- Meta AI (msmsg) message decryption
- Encrypted message-edit decryption module
- Media download inspection helper
- Payment reminder and split-payment builders
messages.decrypt-failure-escalationevent and a publicclient.switchPairingChannel(mode)
See the README's "What's new in 3.0.1" section for the full list.
Published to npm as @aunucore/baileys@3.0.1.
AunuBaileys v2.9.0
AunuBaileys v2.9.0 — Last Fix
The final fix release of the 2.x line. Every remaining open item in the heartbeat ledger was worked through in one batch: the post-2.8.0 filings, the items held for a decision, and the held leads — each one either fixed, verified as already fixed in the tree, or closed with a documented disposition below. Nothing was implemented from invented protocol facts. Full regression suite: 1031 tests (948 at 2.8.0, +83 new).
Fixed — post-freeze filings
- HB-512 —
PresenceTracker's raw emits were the last unguarded emit sites: a throwingpresence.diagnosticlistener escaped the stale-sweep timer as an uncaught exception, and a throwingpresence.changelistener silently truncated the rest of an ingest batch. Both emits are now isolated with try/catch + warn. - HB-141 addendum 1, site 2 —
decodeSyncdPatchdereferencedmutation.record.value.blobwhile collecting patch MACs; a mutation missing its record/value/blob died as a raw TypeError. It is now shape-guarded and skipped per item, mirroring the site-1 guard fixed in 2.8.0. - HB-325 addendum (richResponse) — the
richResponsebranch of message generation dereferenced host content without validation (null submessage elements, code as a bare string, non-array tables/links, null map annotations), throwing raw TypeErrors where sibling branches throw Boom 400. Six dereference points now validate with Boom 400. - HB-435 addendum facet 4 follow-up —
communityFetchAllParticipating()fabricated an empty success from a bare-result IQ without a<communities>child; it now fails with Boom 502, mirroring the groups-side fix in 2.8.0. A present-but-empty<communities/>stays a legitimate success. - HB-435 addendum facet 6 —
getOrderDetails()fabricated{ price: { total: NaN, currency: undefined }, products: [] }from a result IQ without an<order>child; it now fails with Boom 502. - HB-417 addendum facet 3 — a full (non-ranged) media download whose source errored mid-body surfaced a raw TypeError; it now surfaces Boom 502 with the cause preserved.
- HB-388 addendum facet 2 — history sync emitted 'complete' before the chunk's processing result was known, so a failed chunk could still report completion. The emit is now deferred until the outcome is known, with rollback on failure.
- HB-2026-1113-223 addendum 12 —
sendMessagesAgain(and two sibling sites) passed a whole storedWAMessagewhere anIMessagewas expected, producing empty encrypted resends that burned the retry budget. The stored value is now unwrapped once (stored?.message ?? stored) at all three sites. - HB-2026-1112-80 addendum (keyId) — a fractional or non-finite signed-pre-key id passed the old guard and was silently coerced by the encoder (
'abc'/NaN → 0, 1.5 truncated). The guard now requires an integer at both sites. - HB-2026-1112-80 addendum (registrationId, run-1407) — the same class one field over: a fractional
registrationId(e.g. 1234.5) passed the finite-only guard and was silently truncated to 1234 in the retry receipt and the pre-key upload. Both guards now require an integer. - D-1081-A facet — sound stickers gain a
pttpassthrough onto the nested audio message and amaxSecondscap (validated, Boom 400 on violation), closing the two gaps a donor implementation exposed insendSoundSticker/stickerAudio.
Verified already fixed — closed with locking tests
Seventeen items the ledger still listed as open were verified, by reading the guard logic in the tree, to have been fixed by the 2.3.0–2.7.0 releases without the closure ever being transcribed: HB-417 (main), HB-94 addenda, HB-154, HB-160, HB-173 (fixed by restructure), HB-201 addenda 2/3/4, HB-326, HB-371, HB-374, HB-377, HB-386 facet 2, HB-420 facets 1+3, HB-453, HB-281 facet b, HB-2026-1113-226, HB-2026-1112-96 facet 3, and HB-505 facet 4. New locking tests pin the verified behavior.
HB-410 (SPK verification) was likewise already implemented — since 2.6.0, and stricter than the batch brief assumed: injectE2ESession verifies the signed pre-key against the identity key and fails closed with Boom 400, including for bundles without a signature. It is unchanged; loosening it (401 semantics, legacy unsigned bundles) would be a behavior change against 2.6.0 and is not part of this release.
Fixed — held items released
- HB-350 addendum — a successful pre-key message could lose its fresh session when the identity changed mid-flight.
saveIdentitynow accepts apreserveSessionmarker (set only on the pkmsg path): the identity key updates, the session is left untouched. - HB-38 addendum — bare multi-type auth-state sets were not atomic. They now snapshot all keys, write serially, and roll every touched type back to the snapshot on failure, rethrowing the original error. The compensation boundary (a process crash mid-set can still split state) is documented in the code.
- HB-2026-1112-60 addendum 3 — a stuck auth-state transaction could wedge the socket forever, silently. A 120-second watchdog (configurable, sanitised like the retry budget) now logs and invokes a callback; the socket wiring ends the connection with
restartRequiredso recovery happens through reconnect with a fresh mutex. The watchdog never force-settles a transaction. - W6 — the newsletter metadata fallback accepted the first object carrying a string
id, even a foreign one. Fallback candidates must now look like newsletter metadata (a@newsletterid, a create-shaped payload, or at least one characteristic field). - W14/H6/D18 —
updateCoverPhotoproceeded to build its IQ even when the upload response was incomplete; a missingmeta_hmac/fbid/tsnow fails with Boom 502 first.
Fixed — held leads proven real
- L1 — two self-only derefs in
processMessage(absent app-state key share, absent LID payload) threw instead of skipping; both now take the existing skip paths. - L3 — the Noise frame decoder concatenated the whole buffer per chunk (O(n²) on fragmented frames); chunks are now collected and joined with a single concat only when a complete frame is buffered. Byte-identical output.
- L7 — the multi-file auth-state filename sanitizer replaced
/but not\; both now map to__, consistent with the existing behavior. - L12 —
encryptMediaRetryRequestdereferencedkey.idunguarded; a missing or non-string id now fails with Boom 400 at the door. - L24 —
sendWAMBuffernever awaited its IQ, so a timeout was invisible; it now awaits and fails with Boom 408 on timeout.
Closed with a documented disposition (no code)
- HB-2026-1112-60 (main) + addenda 1/2 + latency audit #2 — the global relay mutex is the only serializer that covers shared participant sessions across group sends, DMs, and per-JID decryption; per-destination keys would open a new session-race class that cannot be validated without a live socket. Closed as deliberate design, with the practical impact mitigated by the new transaction watchdog (addendum 3), the LAT-3 negative LID cache (2.7.0), and send-after-commit (HB-178). The per-destination design remains recorded should it ever be validated live.
- HB-446 addendum facet 2 — no discriminator exists: libsignal prunes the session record before any winner is known, so a missing session can be a pruned winner, a legitimately trimmed non-winner, or a ratchet-advanced loser, and no field distinguishes them. Restoring all missing sessions would defeat the session cap permanently. Not forced.
- HB-407 orphan-repair facet + H1 (communities dirty bits) — no enumeration API exists for orphan sessions, and
'communities'is not in thecleanDirtyBitstype union; fixing either would mean inventing storage formats or protocol semantics. Closed without code. - HB-299 addendum residual — the empty-recipient guard already ships (Boom 400); the residual is a documented design boundary of self-paired sockets.
- D-1105-A (five MEX methods), D-1102 socket wiring, D-1107 proto field 108,
parseArgoNewsletter— closed as unverifiable: no query IDs, stanza shapes, proto source, or byte formats are recorded anywhere, and inventing protocol facts is not acceptable. The D-1102 builders shipped in 2.8.0 remain available. - D-1109 — rejected: the donor is a documented trap package; its code is never ported.
- HB-432 addendum facet 1 — partial by design (no enumeration API); no work possible.
- 28 speculative held leads were closed as unproven and 9 stale ones with pointers to their closures. One lead (fractional pre-key counters,
generateOrGetPreKeys) is deliberately not filed from code reading alone and awaits an empirical pass.
Notes
- The 2.x line enters maintenance after this release: the independent v3 implementation is in development and 2.x remains fully supported until it reaches parity (see the v3 notice in the README).
- Three legacy test fixtures that locked in old behavior were updated to the corrected behavior across the 2.8.0/2.9.0 batches; no fix was loosened to satisfy a test.
Published to npm automatically by the Publish workflow.
AunuBaileys v2.8.0
AunuBaileys v2.8.0
The full frozen queue release. Every open item from the heartbeat ledger at the 2.7.1 tally freeze (76 bug numbers + 173 addenda) was worked through in one batch: all four HIGH items, 14 numbered fixes, 25 addenda, and the themed feature set — plus five explicitly deferred items whose recorded evidence is not strong enough to implement safely (listed below, with reasons). Full regression suite: 948 tests (847 at 2.7.1, +101 new).
Fixed — HIGH
- HB-503 —
end()during initial sync discarded messages that had already been receipted but were still sitting in the event buffer. The event buffer'sdestroy()now force-flushes buffered events before discarding them, so a receipted message is never silently dropped on shutdown. - HB-2026-1113-223 addendum 10 — the receipt-failure window: a message whose receipt failed after decryption lost its plaintext permanently, and redelivery degenerated into a MISSING_KEYS stub. The MISSING_KEYS path now checks the recent-message cache first and recovers the plaintext with an upsert + plain ack instead of emitting the stub.
- HB-2026-1113-223 addendum 11 — the decrypted-message dedup set was keyed by the bare message id, so a valid message from another chat or sender reusing the id was acked and dropped. Dedup keys are now namespaced (chat | canonical sender | fromMe | id).
- HB-388 addendum 1 — a failed history-sync chunk download was swallowed: the notification id entered the dedup set (blocking any in-process retry) and the sync still reported 'complete'. A failed chunk now marks the sync status, throws so the id stays out of dedup, and 'complete' only fires for chunks that actually downloaded.
Fixed — numbered bugs
- HB-493 —
canonicaliseValuetreatednulldifferently fromundefined, so the floating-commit freshness check could wrongly report state as stale. - HB-494 + pairing facets — pairing key material is now normalized with
keyMaterialToBufferingeneratePairingKey(a base64-string ephemeral public key previously encrypted into a 44-byte UTF-8 blob instead of the 32-byte key, failing pairing deterministically), androtateSignedPreKey/generatePairingKeyfail with a descriptive Boom 500 on incomplete creds instead of corrupting state. - HB-495 — post-send registration now also runs when the send itself rejects with Boom 408, instead of being skipped on the error path.
- HB-496 —
end()races the socket-end handler against a 5-second timeout (timer cleaned up afterwards) instead of potentially hanging forever. - HB-497 — the file ban-guard store no longer latches permanently after one failed write;
save()always retries andclear()resets the latch. - HB-498 — own 2.7.0 bug: the VP8X EXIF flag written by
addSoundSha256ToStickerWebPwas0x20; it is0x08at both sites now. - HB-504 —
aunuGhostMention/aunuPersonalTagAllguard malformed participant entries instead of throwing. - HB-505 + facets 1–7 — the nine JID predicates threw a raw
TypeErroron truthy non-string input (jid?.endsWithonly guards null/undefined). All nine now answerfalse, andonWhatsAppskips non-string entries before touching them. - HB-506 —
PresenceTracker's subscribed set grew without bound undersubscribeAll; it is now capped with oldest-first eviction, like the sibling collections. - HB-507 + facet 1 (MEDIUM) — prototype pollution: the ordered dictionary used a plain object, so a message id of
__proto__(deliverable via a peer REVOKE/EDIT) reachedObject.prototypethrough the store's reaction/receipt handlers andloadMessage. The dictionary is now prototype-less;__proto__/constructor/prototypeare ordinary keys. - HB-508 + facets 1–3 — the WABinary encoder counted attributes it would not write (non-string values), producing malformed frames; the count now matches the write exactly at the single choke point.
- HB-509 —
messages.deleteonly processed the first chat's keys; deletions are now grouped per chat and applied to each. - HB-510 —
KeyedDB.filtered()passed the wrong index to its predicate for 'after'/'before' windows; pagination is correct now. - HB-511 — a throwing host media cache no longer breaks media preparation: cache reads degrade to a miss and cache writes are best-effort.
Fixed — addenda to older numbers
HB-141 add. 1 (partial — syncd mutation records are shape-guarded before any dereference in decodeSyncdMutations; the sibling decodeSyncdPatch patch-MAC site is still open and queues for the next batch), HB-191 facet 2 (pairing rollback in end() restores the pre-pairing identity snapshot instead of deleting me), HB-208 (product null price/hidden treated like undefined), HB-253 ×3 (empty {interactive:{}}, empty poll values, and empty text are Boom 400), HB-325 ×8 (message-content validation throws Boom 400 instead of raw TypeErrors across text/contacts/a2ui/poll/buttons/carousel/mentions/quoted), HB-334 facet 2 (sendReceipt's else branch validates the jid symmetrically), HB-365 facet 1 (durable fsync writes across the Nyx auth state and the ban-guard store), HB-366 facet 1 (initial upload host list deduplicated), HB-370 facet 3 (event-buffer strips key on the pending path), HB-392 (fetch uploads surface Boom 408 on timeout instead of a raw TimeoutError), HB-405 (the retry manager tracks session recreates so sendMessagesAgain no longer deletes a just-recreated session), HB-410 facet 4 (injectE2ESession requires an integer signed-pre-key id — NaN/float no longer create phantom sessions), HB-417 facet 2 (a ranged download whose source errors mid-body surfaces Boom 502 truncated instead of a raw undici TypeError), HB-435 facets 3/4/5 (newsletter fetch timeout is Boom 408; bare-result IQs without their payload element are Boom 502 instead of vacuous success), HB-478 facets 5–9 (importSessionBackup validates its argument, JSON, and record shape at the door with descriptive errors), HB-482 (data-URL prefix stripping is case-insensitive), HB-239 lid facet (no signal identity is minted for a missing/empty LID), HB-272 facet (device keyIndex 0 is accepted), HB-273 facet 1 (encrypted-stream finish promises are awaited together — no orphan rejection), HB-282 add. 2 (relayMessage options default to {}), HB-320 (a null JOIN_APPROVAL participant from JSON.parse is rejected), HB-335 (user-agent version arrays are validated instead of coerced), HB-2026-1112-38 add. (multi-file auth rollback only restores a file whose bytes are still exactly what the transaction wrote), HB-2026-1112-39 add. (CIPHERTEXT retry receipts are deferred until just after the message mutex releases, preserving ack ordering), HB-2026-1112-112 add. (history inflate is capped at 256 MiB).
New — themed features
sock.aunuSendChatTheme(jid, setting)— set or clear a per-chat theme by relaying aprotocolMessageof type 34 (CHAT_THEME_SETTING) carrying a validatedChatThemeSetting(solid color / stock image / color scheme / clear). Invalid combinations are Boom 400.- HB-499:
aunuSendGroupStatusactually sends now — it was a no-op flag. Content is wrapped ingroupStatusMessageV2with theisGroupStatuscontextInfo, GROUP_STATUS attribution, feature eligibilities, and inner + outer message secrets. - D-1103: HD previews — image/video content accepts
hd?: booleanfor a 200px thumbnail (default stays 32px), plussock.aunuSendHD(jid, content). Media bytes are never re-encoded (verified: identical fileSha256). - D-1104-A: LID↔PN harvesting — group metadata participants already carry both addresses; the pairs are now collected and stored into the LID mapping store from
groupMetadata/groupFetchAllParticipating/groupCreateinstead of being discarded. - D-1106-A:
mex.notificationevent — unrecognized MEX notifications are re-emitted as a typed event instead of being dropped; both spellings of the PaidPartnership operation route to the newsletter handler. - D-1108: AI rich-tag cards —
buildAIRichTagCard(spec)+sock.aunuSendAIRichTagCard(jid, spec): a rich response in abotForwardedMessageenvelope whosebotMetadatacarries the model name override, invoker jid, and validated capability metadata. - D-1102 (partial): scheduled-message builders — clean-room
src/Utils/scheduled-message.ts: AES-256-GCM sealedconditionalRevealMessageencode/decode, the<meta type="scheduled_message">node, the type-32 unschedule protocol message, and the recorded constants (max 30 per chat, 30-day retention, NACK 419). Socket wiring and receipt-side enforcement are deferred (below). - D-1107 (partial): beta-message dispatcher —
src/Utils/beta-messages.tsclassifies beta content keys, rejects blocked classes with Boom 400, and enforces the recorded required fields. - Newsletter metadata resilience (partial) — metadata lookup rotates across three recorded query IDs and extraction tolerates the recorded payload shapes. Deliberate behavior change: when every ID fails,
newsletterMetadatanow throws the last error instead of silently returningnull.
Deferred — with reasons
- HB-446 addendum facet 2 — the recorded candidate fix is ambiguous and dangerous: a session missing from
afterSessionscan be a legitimately trimmed non-winner (run-1039), and treating "missing" as "winner" risks resurrecting trimmed sessions inside the libsignal session/restore machinery. Left open pending a safe discriminator. - D-1105-A (five MEX query methods) — the ledger records no query IDs, variable shapes, or parsers for them, and inventing protocol IDs is not acceptable. Each ID needs live verification before adoption.
- D-1102 enforcement/wiring — the per-chat cap trigger, the NACK 419 receipt path, and the socket send wiring are not recorded anywhere (the donor is builder-only as well).
- D-1107 proto field 108 —
Message.newsletterFollowerInviteMessagelives in generated...
AunuBaileys v2.7.1
AunuBaileys v2.7.1
A focused restoration release. The v7 port had silently lost the entire interactive-message send surface; 2.7.0's sock.aunuCard() threw at runtime because of it. This release restores the surface faithfully from the proven v6 construction, restores the relay companion node that interactive stanzas need in order to render on the recipient's client, and closes the relay/generate parity gap for message secrets. Found live by AunuMD, confirmed by a library deepscan, a live probe series, and independent public sources. Full regression suite: 847 tests.
Fixed
- HB-500 — restored regression (MEDIUM): the
'interactive'and'a2ui'branches ofgenerateWAMessageContentare back.sendMessage({ interactive })again builds aninteractiveMessage(native-flow buttons or a carousel) with the v6messageContextInfoshape instead of falling through toBoom 400 'Invalid media type';sock.aunuCard()andsock.aunuSendA2UI()work again. The restoration also brings back the pieces that were lost with the branches: the A2UI post-processing block (bloksWidgetviabuildAunuA2UIWidget, withsingleScreensupport), theinteractiveAsTemplatewrap (withtemplateId), thewithAunuButtonIconbutton-icon helper, and the missingAnyMessageContenttypings (interactive,a2ui,interactiveAsTemplate,templateId,secureMetaServiceLabel). Malformedinteractive/a2uipayloads are rejected with Boom 400 instead of a raw error. - HB-500 (relay facet) — restored:
relayMessageagain attaches the<biz>companion node (getBizBinaryNode/shouldIncludeBizBinaryNode) for buttons, list, template, and native-flow interactive stanzas, andsendMessagehonours thesecureMetaServiceLabelopt-in via the newaddBizAttributesrelay option. Without this node the server accepts an interactive stanza but the recipient's client never renders it — this was the root cause of cards silently vanishing in production (independently corroborated by three public implementations of the same mechanism). - HB-502 — relay/generate parity:
relayMessagenow stampsmessageContextInfo.messageSecret(32 random bytes) for message types that carry a reporting token when the hand-built proto does not already carry one, mirroring the generate path. An existing secret is never overwritten, and retry resends are excluded so a resend keeps the original message's secret.
Notes
- All changes are restorations of previously shipped behaviour; no breaking changes.
- 13 new regression tests call the real
generateWAMessageContent/sendMessage/relayMessage(no stubs), including stanza-level assertions that an interactive send carries the<biz>node and a plain-text send does not. - README version history updated through 2.7.1.
Published to npm automatically by the Publish workflow.
AunuBaileys v2.7.0
AunuBaileys v2.7.0
Post-marathon release: the whole post-2.6.0 queue (13 numbered fixes, 31 numbered addenda), six feature deltas, the call-signaling layer deferred from 2.6.0, and three latency fixes from a dedicated send/receive audit. Full regression suite: 834 tests.
Fixed
- HB-480 — the companion-registration flow no longer writes
creds.advSecretKeybefore thecompanion_finishIQ succeeds. - HB-481 (+ facet 1, + facet 2) — a message is no longer marked acked before its receipt/ack send completes, so a throwing send no longer loses the upsert without a NACK. Covers the decrypt-failure, placeholder, PDO, LID-receipt, sender and fallback branches, six more ack sites, and the second
hist_synchistory receipt in the success branch. - HB-482 —
getMediaKeysstrips anydata:<mediatype>;base64,prefix, not only the literal empty-mediatype form. - HB-483 — ignored MESSAGE stanzas get a plain ack instead of a 500 NACK that caused a redelivery loop.
- HB-484 — an empty cached device list is no longer treated as a cache hit that silently drops group members.
- HB-485 (+ addendum facet 1), HB-486 — a throwing host
shouldSyncHistoryMessagecan no longer lock history sync inAwaitingInitialSyncor silently drop a history-sync payload, at theconnection.updategate, theupsertMessagegate, and the socket-construction site. - HB-487 — host-supplied profile-picture and thumbnail dimensions are validated at the boundary and rejected with Boom 400 instead of surfacing raw image-library errors.
- HB-488 — the product-image "already on WhatsApp" check parses the URL hostname instead of matching a
.whatsapp.netsubstring anywhere in the URL. - HB-489 (+ facet 1) — the device cache is keyed by the normalised JID (user + server), so
@hostedand@s.whatsapp.netno longer share an entry; USync results are also aliased under the chat-input JID key, so sends to hosted (Cloud API) recipients no longer pay a full USync IQ on every send. - HB-490 — a pending chat update merged during absorption now wins over the snapshot, so archive/mute/pin are no longer silently discarded.
- HB-491 — restored regression: the
pollResultbuilder is back.sendMessage({ pollResult })again builds apollResultSnapshotMessage(field 88), orpollResultSnapshotMessageV3(field 115) forpollType === 1, instead of throwing "Invalid media type". - HB-492 —
prepareStickerPackMessagesticker conversion is concurrency-capped (4 in flight); previously up to 60 parallel full-size conversions could exhaust memory on small hosts (~4.4 GiB extrapolated peak at the cap).
Plus 31 numbered addenda, including: strict validation of encrypted session-backup envelopes and payloads before any file is touched (HB-478 facets 3–4); a default 10-second timeout for fetchLatestWaWebVersion (HB-450 facet 1); exact key-length guards for identity and pre-key material (HB-2026-1112-26 facet 1, HB-98, HB-410 addendum); descriptive Boom errors instead of raw crypto/protobuf errors on the handshake and pairing paths (HB-238 addendum 2, HB-239, HB-453 facet 1); Boom 408 instead of fabricated empty success on timed-out order/group/community fetches (HB-435 facets 1–2); a throwing onGetChat hook no longer loses group messages (HB-140 facet 2); the media-upload host allowlist now covers the streamable path (HB-114 addendum); and a per-sender placeholder-resend cap (HB-2026-1112-40 addendum 5).
One addendum is partial: HB-432 addendum facet 1 — LID→PN pairs that exist only on disk and were never read by the running instance remain invisible to the pair cap (there is no SignalKeyStore enumeration API); the batch-prune and seen-pairs facets landed.
Latency (send/receive audit)
- LAT-1 —
assertSessionsvalidates per-recipient sessions in parallel (Promise.all) instead of sequentially. - LAT-2 — the fixed 250 ms retry backoff no longer runs inside the global retry mutex.
- LAT-3 — negative LID lookups are cached for 60 s (invalidated on any positive mapping write), so messages from/to unmapped numbers no longer pay repeated USync fetches on every message.
New
- Call signaling (deferred from 2.6.0, clean-room from spec):
CallSignalingTracker,monitorCallSignaling,createCallSignalingTracker,parseSdp, andcall.*events (offer/accept/reject/terminate/ice/preaccept). Inbound call stanzas are surfaced and tracked; no VoIP media is implemented. - Audio stickers:
sendSoundSticker— a sound sticker whose WebP EXIF carries the audio's"sound-sha256"(StickerMessage field 26, already in our WAProto — no proto patching), plus theaddSoundSha256ToStickerWebPhelper and thestickerAudiocontent variant. renderWhatsApp— formatted-text AST (bold/italic/code/link/mention) rendered to WhatsApp text, with a mention collector.sock.groupAcceptInviteWithStatus()— structured pending result for group joins that need approval (legacygroupAcceptInviteunchanged).syncSignalSession— socket method withforce/reasonIdentityoptions for targeted session rebuilds.- History-sync streaming sink:
SocketConfig.history.sink(HistorySyncSink) receives each history-sync item as it is processed, viastreamHistorySyncToSink. sender_dropplaceholders are classified as their own kind and excluded from resends.asMediaBufferChunkis exported for chunked media handling.
Notes
- All public API additions are additive; no breaking changes.
- README version history updated through 2.7.0 (it previously stopped at older versions).
Published to npm automatically by the Publish workflow.
AunuBaileys v2.6.0
Third and final batch of the marathon: the entire remaining queue is fixed — 23 numbers, every named addendum, plus a full sweep of all other open addenda in the ledger. Queue is now zero except the HELD-for-decision items listed below.
Signal / LID / auth (HB-410 MEDIUM, HB-456, HB-461, HB-464, HB-467, HB-477, HB-478, HB-479): signed pre-key signatures are now verified against the identity key before a session is created, rejecting bundles that fail (HB-410 — note for review: this verifies the signature only; it does not decide TOFU / isTrustedIdentity, which remains open). Duplicate SKDM delivery no longer evicts other sender-key states. getUSyncDevices no longer duplicates warm-cache devices on self-DMs. waitForConnectionUpdate settles on an already-closed socket. Pairing-code length errors are Boom 400. Nyx auth state staging gaps closed: recoverCreds now uses the strict credential gate for creds.json and .bak (HB-477), and importSessionBackup is atomic with strict base64 validation (HB-478). The pair-success handler now emits creds.update only after the pair-device-sign reply has gone out (HB-479).
Media (HB-417, HB-423, HB-426, HB-451, HB-457, HB-463, HB-465, HB-466, HB-468, HB-474): ranged downloads validate 206/Content-Range and reject 200-instead-of-206; redirect Location parsing can no longer crash the process; relative redirects keep ?auth=/?token=; frames over 16 MiB are rejected instead of silently truncated; cross-host redirects are same-origin only; the dead jimp branch in extractImageThumb is fixed; padding errors no longer surface as raw Node crypto errors before the MAC check.
Messages (HB-427, HB-452, HB-454, HB-458, HB-476): media-retry success without directPath is a Boom 502, not a raw TypeError; non-object message content is Boom 400; protocol cases tolerate store failures; decrypt() no longer throws its own TypeError for non-Error values; the CB:status route now applies both ignore filters. Empty-object content branches (location, react, listReply, aiRich, groupInvite, buttonReply) are rejected with Boom 400 at the source, mirroring the album guard.
Feature deltas (re-implemented from spec, nothing ported): Kage favicon link-preview, clearChat deleteStarred, useNyxAuthState (our own opt-in design: atomic writes, .bak auto-restore, corrupt-file quarantine, session backup export/import), and a rewritten-from-spec presence tracker. Call-signaling is deferred to 2.7.0 (needs a state machine + SDP parser; no half-done code shipped).
Suite: 648 tests, all passing (441 baseline + 207 new). Build clean, guardrail gate passed.
HELD for Aunu's decision (not fixed): HB-350 main facet, HB-407 orphan-repair facet, HB-38 addendum, HB-2026-1112-60 and its addendum 1 (LID lookups inside decryptMessage). No breaking changes; all fixes are additive and locked by regression tests.
Published to npm automatically by the Publish workflow.
AunuBaileys v2.5.0
Highlights
- Poll-vote send:
sendPollVote(jid, vote)withencryptPollVote— vote on polls from the socket, with full validation (Boom 400 on bad keys/options). - Peer-triggered session churn closed (HB-405): a peer can no longer force unbounded session deletion by retrying many message ids with
error="7"— peer-supplied recreates are throttled to one per peer per hour, while our own MAC failures still recreate immediately (HB-380). - Retry receipts that actually carry the right error class (HB-453): Bad MAC → 7, invalid signature → 5, future message → 6, proven no-session → 1, instead of a literal
0. - Placeholder resend no longer poisoned by a failed send (HB-418): a PDO send that throws used to leave a stale dedupe entry blocking re-requests for an hour; the entry is now cleared on send failure.
- 30 bug fixes + 3 feature deltas, all locked by 112 new regression tests.
Fixes
- Socket/connection: no phantom
connecting/open/creds.updateafterend()(HB-413, HB-428); QR chain races fixed (HB-419, HB-422); hosted-device domain handling (HB-414); auto-join rerun on reconnect (HB-444); version fetch honours the host abort signal (HB-450); Boom 502 on missing digest (HB-455); pairing rollback on pending pairing (HB-262 addendum); Noise handshake length guards (HB-238); pairing HMAC null guards (HB-239); registrationkeyIdvalidation (HB-2026-1112-80); async listener rejections no longer crash the process (HB-268); duplicate pair-device IQs join the running QR chain (HB-2026-1114-243). - Retry/decrypt: resend batches survive pre-loop and per-id cache failures (HB-420 + addenda); device-99 JIDs filtered from session deletes (HB-424); per-user isolation in device notifications (HB-437); linked-profile updates store-then-emit (HB-442); bundless retry receipts no longer force a session assert (HB-472);
creds.accountvalidated before building retry receipts (HB-201 addendum 2);creds.updateemitted only after the receipt transaction commits (HB-386 facet 2); placeholder requests no longer hold the retry mutex (HB-2026-1112-39);parseRetryErrorCoderejects partial parses like"7abc"(HB-405 C11). - Send/relay: tc-token and sender-key read failures degrade gracefully (HB-416 + addenda); LID mapping persist failures don't drop USync results (HB-430); media-update waits resolve on send failure (HB-433); group metadata cache failures fall back to live fetch (HB-448); no more 0-byte
<device-identity>nodes (HB-201 addendum 3); USync timeouts fail hard (408) instead of sending to a partial device list (HB-439); per-message star patches (HB-436); history-syncrecentSyncPausedflag so a latecompletestill emits (HB-443); viewOnce routing viawrapAunuViewOnce(HB-441); participant-node patch filtering (HB-269 facet 4). - Store/history/buffer: pending conditional chat updates merge instead of overwriting (HB-412); live upserts vs history sets no longer lose or duplicate notifies (HB-421); key-less history entries skipped (HB-181); emit type-mismatch clears before emit (HB-2026-1113-166 addendum 1);
chats.update {name: undefined}no longer clobbers buffered upserts (HB-411 addendum 6);chats.lock,group-participants.updateandgroup.join-requestare now buffered (HB-425 addendum);groups.upsertjoins the event buffer (HB-425 MAIN); redelivered ciphertext stubs no longer overwrite good stored copies (HB-2026-1113-223 addendum 7); throwing device caches ingetUSyncDevicesdegrade to a USync fetch (HB-475); floating-retry stale overwrites fixed in auth state (HB-473 addendum). - Decisions:
saveCredsstill throws by design on persist failure — all 20 in-treecreds.updateemit sites are guarded (HB-2026-1112-34). - Deltas: poll-vote send (
sendPollVote); CB:status<enc>routing to the message handler; Kage LID addressing helpers (getMeParticipant,getQuotedParticipant) wired into message generation.
Notes
- Held for a decision (not force-fixed): HB-350 main facet, HB-407 orphan-repair facet, HB-38 addendum, HB-2026-1112-60. Deferred to the 2.6.0 sweep: HB-191 addendum (needs the Noise-handshake harness), HB-2026-1112-38.
- Full suite: 441 tests passing (329 carried over + 112 new).
Published to npm automatically by the Publish workflow.
AunuBaileys v2.4.0
2.4.0 — 2026-11-23
Signal & sessions
- HB-446 (MEDIUM): a stale message from an archived session no longer corrupts the healthy open session —
decryptMessagesnapshots the record before decryption and restores every non-winning session that changed. - HB-409 / HB-449: session migration reconciled — per-device migration re-reads both records inside the transaction, an open target session wins unless the source was established more recently, and the stale
migratedSessionCacheis removed entirely. - HB-469: sender-key peer names are canonicalized PN↔LID, so group messages from an author known under the other spelling stay readable.
- HB-440:
deleteSessionisolates per-JID failures instead of aborting the batch. - HB-367 addendum: key bundles whose key field is not exactly 32 bytes are rejected or skipped instead of injecting a phantom session.
- HB-371 addendum facet 5 / HB-416 addendum 3 / HB-94 addenda: transient store/validation failures no longer count as decrypt strikes,
assertSessionsdegrades gracefully when the LID lookup throws, and sender-key deletion is transactional per group.
LID mapping
- HB-407 (+ mirror and orphan addenda): empty, non-digit and all-zero users are rejected at the
storeLIDPNMappingschoke point —'0@lid'poison can no longer be written, and legacy poison reads as a miss. - HB-415 (+ addendum): stale or missing reverse mappings are repaired from the store instead of being trusted from cache.
- HB-358 facet 5: intra-batch LID collisions dedupe symmetrically, last-wins in both directions.
- HB-459: a nested
storeLIDPNMappingsinside a rolling-back transaction no longer leaves the cache claiming a mapping the store never persisted. - HB-432: the persistent LID-mapping store is capped (LRU eviction, default 10,000 pairs, configurable via the new optional
maxEntries). - HB-470: LID learning from live traffic works again —
learnFromKeyand themessages.upsertlistener now read the fields the decoder actually sets (remoteJidAlt/participantAlt) through the new shared helperextractLIDPairsFromKey.
Auth state
- HB-473: commit retries no longer hold the per-key transaction mutex for the whole retry loop — the first attempt stays serialized inside the mutex, retries release and re-acquire between attempts.
- HB-438: permanent commit errors fail immediately instead of stalling ~27 s in retries; transient errors still retry.
- HB-429: transaction mutex keys are namespaced, ending self-deadlock on type-named transactions.
- HB-151 facet 6 / HB-315 addendum 2 / HB-2026-1113-143 addendum 2:
isValidCredsShapenow validatesprocessedHistoryMessages(must be an array),creds.me.id(a valid own JID whenmeis present), and exact key-material lengths. - HB-116 addendum: the auth folder is created with mode
0o700. - HB-350 mitigation: in the multi-file auth state, file deletions (in practice pre-key files) now run only after every write in the same set has committed; a failed write propagates as an error and the deletion never happens.
Store
- HB-406:
group-participants.updatekeeps producer fields in sync (admin/isAdmin/isSuperAdmin, plus themodifybranch). - HB-411 (+ addenda 2–5): undefined stub fields no longer wipe stored group/contact fields; boolean stub facets and subject/description owner fields propagate correctly.
- HB-431: an own
fromMenotify no longer creates an unknown chat withunreadCount: 1. - HB-445 + HB-278 addendum 2: label-association keys use a
'\0'separator, ending silent overwrites. - HB-460: participant entries without an id are dropped instead of being stored as phantoms.
- HB-373 addenda:
chats.deletealso dropsgroupMetadata;isLatestwipes clear stale presences/groupMetadata/labelAssociations; participant remove clears presence. - HB-2026-1112-40 addendum 4 (store facet): identity-less participants are dropped for every store action.
- HB-2026-1113-223 addenda 3–6: decrypt-failure classification corrected (over-2000 group counter, 33-byte signing key, legitimate redeliveries), plus stanza-level dedup so a redelivered message never counts toward an E2E session reset; strikes now reset on successful decrypt.
Tests
- 54 new regression tests (329 total, all passing). Build is clean.
Published to npm automatically by the Publish workflow.