Commit Graph

846 Commits

Author SHA1 Message Date
vini 432c26a07c fix(messages): handle encryption failures per recipient and fail when all fail (#2226) 2026-01-08 22:07:11 +02:00
Ibrahim Pelumi Lasisi 720cc688d6 fix: avoid variable shadowing and preserve empty business profile fields (#2183)
* Update business.ts

* chore: fix lint issues
2026-01-08 21:56:13 +02:00
Gustavo Quadri 81d9c12e86 fix: getmessagetype to ensure consistency with whatsapp behavior (#2245) 2026-01-08 21:51:34 +02:00
João Lucas de Oliveira Lopes c9c3481817 implement message reporting tokens (#1906)
* feat: implement message reporting tokens and privacy token handling

* feat: add support for privacy tokens in profile picture requests and history sync

* chore: pr feedback purpshell

* fix: improve privacy token handling and error messaging in socket configuration

* feat: enhance privacy token handling with improved sender mapping

* chore: removing tc token in favor of #2080

* chore: revert some unecessary changes

* feat(reporting): enhance reporting token extraction and compilation logic

* feat(reporting): add unit tests for reporting token utilities

* fix(reporting): streamline reporting token attachment logic in message sending

* fix: adjust reporting token inclusion logic to prevent retries

* chore: add return type to shouldIncludeReportingToken and improve getToken function type safety
2026-01-08 21:50:49 +02:00
Matheus Filype 250477497d Add Feature LabelMember (Based on #2164) (#2198)
* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8e6fc6cbfbb9d1f8f67c169700e704213d.

* feat: add group member label update functionality and event emission

* feat: refactor updateMemberLabel function for improved readability

* feat: use optional chaining for label association message in processMessage

* feat: add updateMemberLabel to makeMessagesSocket for enhanced functionality

* fix: correct log message for group member tag update event

Co-authored-by: FgsiDev
2025-12-19 22:00:48 +02:00
Matheus Filype b7960dbb9a feat: Optimize Offline Node Processing with Batching and Event Loop Yielding (#2138)
* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8e6fc6cbfbb9d1f8f67c169700e704213d.

* fix(messages-recv): improve offline node processing and error handling

* feat: improve offline node processing by yielding to event loop
2025-12-12 06:50:18 +02:00
YonkoSam 1e6f65cf5e fix Memory leak in makeMutex - Promise never gets garbage collected (#2151)
* Memory leak in makeMutex - Promise never gets garbage collected

Hey, I've been debugging a memory leak in my application and traced it back to the makeMutex implementation.

The current implementation chains promises indefinitely without ever breaking the chain:

Every call to mutex() creates a new Promise that awaits the previous task, then becomes the new task. The problem is the old promises never get released because each one holds a reference to the previous through the closure.

What I found
Took a heap snapshot after running for a while and found hundreds of Promises from make-mutex.js holding ~15MB and growing. The retainer graph shows a long chain of Promises all pointing back to each other.

Since processingMutex handles every incoming message/notification, this chain grows constantly and never shrinks.

This keeps the same mutex behavior but lets the GC clean up old promises every 50 tasks instead of holding them forever.

* Refactor makeMutex to use AsyncMutex directly

* lint

* revert
2025-12-12 04:35:24 +02:00
Matheus Filype 829fa8d601 feat: Mutex redesign - isolate event processing for better ordering and throughput (#2137)
* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8e6fc6cbfbb9d1f8f67c169700e704213d.

* fix: introduce separate mutexes for message, receipt, app state patch, and notification processing

* fix: remove unused processing mutex for notifications
2025-12-12 04:34:59 +02:00
João Lucas de Oliveira Lopes 674f116b00 fix(messages-recv): cancel pending phone requests for message retries (#2147) 2025-12-05 23:41:14 +02:00
YonkoSam 96e4e04239 Await cache checks for message resend logic (#2136) 2025-12-05 23:40:38 +02:00
Rajeh Taher f46e8b118c messages-recv: handle newsletter and unavailable message acks 2025-11-21 17:35:46 +02:00
Rajeh Taher 23f1268918 messages-recv: remove outdated case for privacy_token 2025-11-21 17:09:06 +02:00
Rajeh Taher 129df47fbb revert #2010 2025-11-19 16:57:22 +02:00
Rajeh Taher e3cc1acec0 messages-recv: ignore only view once messages 2025-11-19 16:54:57 +02:00
Rajeh Taher 247c717881 messages, auth: rename 'contacts-tc-token' to tctoken 2025-11-19 16:35:18 +02:00
Rajeh Taher 50d410d117 chore: lint 2025-11-19 16:25:56 +02:00
vini a70e4da1c4 feat(signal): better parity with whatsapp web (#1967) 2025-11-19 15:20:49 +02:00
Marc Knaup 3be21f8b99 Added missing attribute to community participant removal (#2004) 2025-11-19 15:20:07 +02:00
Cassio Santos 5c456e514e fix: cannot send message on new Whatsapp Business limited accounts (#2080)
* fix: cannot send message on new Whatsapp Business limited accounts

* chore: add woraround to resend the message on 475 errors

* fix: lint

* fix: add handler

* fix: lint

* Update src/Socket/messages-send.ts

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2025-11-19 15:18:19 +02:00
vini 40f128d88a feat(events): decrypt event responses (#2056) 2025-11-19 15:17:21 +02:00
vini b4863b624e refactor(retry): improve message encryption and retry logic (#2055) 2025-11-19 15:13:51 +02:00
João Lucas de Oliveira Lopes 9b012baa5c fix: suppress receipts for newsletter messages to prevent disconnection (#2071) 2025-11-19 15:13:03 +02:00
João Lucas de Oliveira Lopes e5f820d119 fix: gracefully handle unavailable view-once messages and improve log error (#2070) 2025-11-19 15:12:28 +02:00
Rajeh Taher abf5af0e72 history: improve history sync and support new payload 2025-11-07 00:16:15 +02:00
Rajeh Taher 29318cf6c2 chore: lint and re-organize 2025-10-20 00:37:37 +03:00
Rajeh Taher cc3cd17392 cleanup: remove string lid / jid refs and improve hosted support 2025-10-20 00:05:54 +03:00
Rajeh Taher 2e47d4b66b messages-send, signal: improve hosted device support + patch cache 2025-10-19 23:56:05 +03:00
Rajeh Taher 928fa6ac66 messages-recv: simplify retry logic + re-do acks 2025-10-18 21:02:58 +03:00
Rajeh Taher 7ee0b61716 chore: lint 2025-10-18 20:35:36 +03:00
Rajeh Taher 07536dedfc process-message: check fromMe properly in message addons 2025-10-18 20:28:58 +03:00
Rajeh Taher e41a66b3c4 libsignal,lid-mapping, etc.: Partially fix "No sessions" on hosted JIDs 2025-10-16 18:31:01 +03:00
Rajeh Taher d0feb240fa chore: lint 2025-10-16 13:26:58 +03:00
Rajeh Taher 93b87e4653 messages-send: add meta tag on peer messages 2025-10-15 22:49:34 +03:00
Rajeh Taher d9c3b5aaf3 defaults, socket: sync full by default, prekey count set to 812 2025-10-15 19:16:25 +03:00
Rajeh Taher c84b20703c connection: update headers and other things 2025-10-15 17:52:52 +03:00
vini 20c43d1d3c chore: remove unnecessary info logs (#1893) 2025-10-11 13:45:38 +03:00
Rajeh Taher 2989bccb61 wam: cleanup 2025-10-10 03:50:38 +03:00
Rajeh Taher f56293365f chore: avoid npm warnings (update conventional-changelog) 2025-10-08 19:46:39 +03:00
Rajeh Taher c41aae78c2 messages-send,jid-utils: get deterministic server for user 2025-10-08 02:46:09 +03:00
Rajeh Taher 9e4dbb2e22 signal,messages-send,libsignal: properly parse and ignore hosted devices 2025-10-08 02:25:26 +03:00
Rajeh Taher 54db127303 defaults,utils: Minimize vectors for automation detection 2025-10-07 20:29:47 +03:00
Rajeh Taher acc5111792 group events: fix serialization issue 2025-10-07 20:17:07 +03:00
Gustavo Quadri 60c688b85d Fix fetchLatestWaWebVersion to bypass WhatsApp anti-bot detection with minimal headers (#1883)
* fix: fetchLatestWaWebVersion to curl

* fix: lint

* fix: fetchLatestWaWebVersion to bypass WhatsApp anti-bot detection with minimal headers

---------

Co-authored-by: João Lucas <jlucaso@hotmail.com>
2025-10-07 20:06:45 +03:00
Rajeh Taher 9a8f19461c messages-send: Don't send group skdistMsg to hosted id 2025-10-06 00:46:06 +03:00
Rajeh Taher c5b0001b61 *group: parse @lids properly when processing group notifications
*This commit is breaking, it changes the format of participants in group-participants.update.
2025-10-05 23:56:14 +03:00
Rajeh Taher 09263aa3d2 libsignal: Process @hosted conversions to @hosted.lid 2025-10-05 22:51:13 +03:00
Rajeh Taher dd93b641c9 Signal, messages-recv, jid-utils: Handle ADJIDs properly in Signal 2025-10-05 19:09:28 +03:00
Rajeh Taher 38e0f2c0e6 Signal, messages-recv: Fix previous commit, fix log 2025-10-04 15:30:04 +03:00
Rajeh Taher 334977f983 general: revert #1665 2025-10-03 18:14:30 +03:00
Rajeh Taher 37d729b33a messages-recv, decode-wa-message: handle storing new pairs better + lint 2025-10-03 01:17:37 +03:00