Commit graph

879 commits

Author SHA1 Message Date
Adi1231234
6de0b0dd2b
fix: prevent store model mutation in getContact and getChatModel LID handling (#127098)
* fix: prevent store mutation in getContact/getChatModel LID handling

getcontact() and getChatModel() overwrite .id directly on live Backbone
model references from WhatsApp Web's Contact/Participant store. This
permanently corrupts the store for the lifetime of the session, causing
all subsequent lookups for the same contact to crash with:
- "Cannot read properties of undefined (reading '_serialized')"
- "Data passed to getter must include an id property"

the fix resolves LID to phone on the serialized copy only, never
touching the live store model.

fixes #127054

* perf: use BusinessProfile.find() instead of fetchBizProfile()

businessprofile.find() checks the local cache first and only fetches
from the server when the profile is missing, while fetchBizProfile()
always makes a network call (~85-100ms per contact). This significantly
reduces latency when getContact is called repeatedly for the same
business contacts.

closes #201656

co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove unnecessary try/catch around BusinessProfile.find()

businessprofile.find() never throws for non-business contacts - it returns
a BusinessProfile model with profileOptions: null, not an error. The comment
was factually incorrect. The existing profileOptions guard handles the
non-business case correctly without any exception handling.

verified in WhatsApp Web DevTools: find() returns a valid object for regular,
business, LID, and even non-existent contacts. Only throws when called without
an id, which cannot happen here.

co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: simplify contact/chat model utils via native WA functions

replace the O(n²) LID participant loop with WAWebLidMigrationUtils.toPn()
which resolves LID WIDs via LidPnCache in O(1). Remove the findContact
wrapper since Contact.find() accepts strings directly. Use
wawebwidfactory.createWidFromWidLike() for safe isLid() calls that handle
plain-object contact ids without WID prototype methods.

co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: skip BusinessProfile.find() for non-business contacts

wa's own source guards this behind isBusiness || isEnterprise
(WAWebUseBusinessProfile.react). No point querying business profiles
for regular contacts - saves a wasted IQ roundtrip (~80ms) per call.

* revert: remove block/unblock changes from this PR

moved to a dedicated PR (#201671) with a proper fix using
wawebblockcontactutils.getContactToBlockOnlyUseIfNoAssociatedChat()
for correct LID resolution.

* fix: convert contactId to Wid before collection find() calls

contact.find() and BusinessProfile.find() reject plain strings when
the entry is not cached or stale, throwing "gadd called without an id
attr". Use createWid(contactId) to ensure a proper Wid object is passed.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 10:00:11 -03:00
BenyFilho
b0e869317f
Fix: Message get Mentions (#201669)
* fix Message get Mentions

* Update Message.js

check if m is a string

* Update Message.js

* Update Message.js

* Update Message.js

* Update Message.js

* Update Message.js

* Update Message.js

* Update Message.js

* Update Message.js

* Update Message.js

* Update Message.js
2026-03-17 23:18:06 -03:00
Lindionez
9899f4027a
fix: joinGroupViaInvite (#127102)
* Fix correct module

* fix: joinGroupViaInvite not working
2026-03-16 10:53:57 -03:00
Bastian Novoa
03498ea477
fix: WAWebSendReactionMsgAction call to use sendReactionToMsg method (#127101)
* update WAWebSendReactionMsgAction call to use sendReactionToMsg method

The WhatsApp Web internal API changed the WAWebSendReactionMsgAction module 
from a directly callable function to an object with a sendReactionToMsg method.

Before:
  await (window.require('WAWebSendReactionMsgAction'))(msg, reaction);

After:
  await (window.require('WAWebSendReactionMsgAction')).sendReactionToMsg(msg, reaction);

This fixes the TypeError: window.require(...) is not a function error
thrown when attempting to react to messages.

* Refactor react method for improved readability

* Update Message.js

Co-authored-by: @BenyFilho

* Update Message.js

Co-authored-by: @Benyfilho

* Update Message.js

Co-authored-by: @BenyFilho

* Update Message.js

Co-authored-by: BenyFilho <BenyFilho@users.noreply.github.com>

---------

Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
Co-authored-by: BenyFilho <BenyFilho@users.noreply.github.com>
2026-03-14 16:56:49 -03:00
2^1
807efd502d
chore: cleanup, ci workflows and formatting (#127064)
* ci: setup workflows, dependabot, labeler and commit linting

* docs: update README, community files and issue templates

* chore: configure prettier, editorconfig and format codebase

* chore: restore changes lost during rebase

* docs: adjust url for new logo

* fix: align badges

* chore: resolve conflicts and re-add temp lint
2026-03-10 01:45:12 +02:00
BenyFilho
c2d978fd0a
Fix Block Contact (#127093) 2026-03-08 11:56:04 -03:00
Lindionez
d933a0881f
FIx getProfilePicUrl (#127092)
* Applying correction given on discord

* Update Client.js

* Update Client.js

* Update Client.js

---------

Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
2026-03-08 11:54:47 -03:00
Rajeh Taher
883d7e4eda
Store: remove all mentions of window.Store (#127077)
* Store: remove all mentions of window.Store

* Apply suggestion from @BenyFilho

Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>

---------

Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
2026-03-01 16:49:21 -03:00
BenyFilho
9e42f1e0c3
Fix: Frozen WhatsApp Start or Auth Timeout (#127048) 2026-02-18 09:03:01 +02:00
Rajeh Taher
9b1eb76b2b
general: tree-shaking pre-MD and old comet versions (#5675)
Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
Co-authored-by: tuyuribr <45042245+tuyuribr@users.noreply.github.com>
2026-02-10 23:24:54 +00:00
2^1
073cf3185d
Revert "ci: add rate limits for issues and prs (#66265)" (#104563)
This reverts commit 4166311daf.
2026-02-10 19:55:12 -03:00
2^1
4166311daf
ci: add rate limits for issues and prs (#66265) 2026-02-10 13:48:40 -03:00
BenyFilho
9ba93d60ec
Fix loading_screen event (#5808) 2026-02-06 21:45:26 -03:00
BenyFilho
2056ae83e1
Fix getFormattedNumber (#5806) 2026-02-06 21:44:15 -03:00
BenyFilho
9e0fe29218
New Chat property isLocked (#5798)
* New property isLocked

* New property isLocked
2026-02-06 21:42:51 -03:00
BenyFilho
9b53bebfd2
Fix PDF Caption (#5794) 2026-02-06 14:09:11 -03:00
Adrián Lizaga
48a9e1d80e
fix: disconnected event is not being fired (#5807) 2026-02-06 14:06:55 -03:00
kivirick
50485349c3
Fix setDescription to use updated group metadata (#5793) 2026-02-03 20:38:57 +00:00
A. Rifqi Yarzuq Arfani
e66d94efd9
Fix update channel module (#5791)
* Fix getChats (#5779)

* Fix: getChats -> getChatModel -> GroupMetadata and NewsletterMetadata

* Fix module change

* fix: change wrong update module of channel

* fix: correct reference to pupPage in deleteChannel method

---------

Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2026-02-03 22:36:16 +02:00
Adi1231234
98cdced13f
copy only requiredDirs and make storeRemoteSession safer (#3744)
* copy only requiredDirs and make storeRemoteSession safer

* replace fs-extra copy with native fs cp function
to avoid unhandled exceptions bug in fs-extra

* add recursive option to cp for folders copy

* fix: correct indentation in storeRemoteSession method

Fixed ESLint indentation errors (lines 105-127) by changing from
2-space to 4-space indentation to match project standards.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix formatting of session save object in RemoteAuth

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 00:37:15 -03:00
Merlin
42d0c40e2e
Adapt TypeScript Events enum (#3271)
* Add missing js Events to ts Events enum

* Placing back call

Placing back call

* Update index.d.ts

---------

Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
Co-authored-by: tuyuribr <45042245+tuyuribr@users.noreply.github.com>
Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
2026-01-31 13:33:11 -03:00
WWebJS Bot
047278b6e1 chore(v1.34.6): bump version and generate docs 2026-01-30 16:40:01 +00:00
WWebJS Bot
92e7e0d751 chore(v1.34.5): bump version and generate docs 2026-01-30 16:33:24 +00:00
BenyFilho
32e404292b
Fix Channels WhatsApp module change (#5787) 2026-01-30 15:31:07 +02:00
BenyFilho
ce9dd1d678
Removing unused and unavailable module (#5785) 2026-01-30 10:12:41 -03:00
BenyFilho
207a5ad104
Fix getChats (#5779)
* Fix: getChats -> getChatModel -> GroupMetadata and NewsletterMetadata

* Fix module change
2026-01-30 10:50:19 +02:00
Adi1231234
d5fd776356
avoid hang by closing browser only if connected (#3847)
* avoid hang by closing browser only if connected

* fix: correct indentation in destroy() method

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 00:58:41 -03:00
tuyuribr
949c637130
Update Chat.js (#5712) 2026-01-30 00:47:44 -03:00
Vedant Mohan Goyal
e6fd112559
Store RemoteAuth ZIP files inside dataPath (#3375)
* Use `/tmp` when running inside AWS Lambda

* Revert unintended change accidentally committed

* Revert "Use `/tmp` when running inside AWS Lambda"

This reverts commit 8e5324786e5b0067498717d3827937dac0f1edb6.

* Store RemoteAuth ZIP files inside dataPath

* Discard changes to src/webCache/WebCache.js

---------
2026-01-30 00:29:30 -03:00
Yovangga Anandhika
58990a8159
change concurrency 10 (#3330) 2026-01-30 00:25:25 -03:00
tuyuribr
47bf416255
Update update.yml (#3952)
Please stop updating the waweb version

Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
2026-01-30 00:15:18 -03:00
alessandrocampos224
6c3f10e1d2
fix: update call handling for recent WhatsApp Web changes (#5775)
* fix: update call handling for recent WhatsApp Web changes

Updated the call handling logic to accommodate the renaming of Store.Call to WAWebCallCollection in recent WhatsApp Web versions. This ensures that incoming calls are properly managed without breaking functionality.

* Update Client.js

---------

Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
Co-authored-by: tuyuribr <45042245+tuyuribr@users.noreply.github.com>
2026-01-29 22:58:08 -03:00
noelcarcasesLYN
b03680a70c
Fixes media upload to channels (#5697)
Ensures correct media upload to channels by using the mimetype from mediaInfo, rather than the file, when creating OpaqueData.

Also, it replaces the call to the function getRandomFilehash with the value of the function to retrieve the correct token.

Co-authored-by: Noel Carcases <noel.david.carcases.gomez@ibm.com>
Co-authored-by: Shir Serlui <70711723+shirser121@users.noreply.github.com>
Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com>
2026-01-30 01:55:30 +00:00
BenyFilho
303caf9ba2
Fix deleteAddressbookContact (#5672) 2026-01-30 01:51:38 +00:00
BenyFilho
84c45c9558
Fixing method saveOrEditAddressbookContact (#5673) 2026-01-29 22:50:45 -03:00
Naor
c61a2ef189
fix: send sticker 2026-01-29 19:34:58 -03:00
Naor
fc2e97e5ab
Refactor sendSeen to include threadId parameter 2026-01-29 19:32:41 -03:00
Filipe
dd9df4083a
fix: use markSeen instead of sendSeen to fix markedUnread error (#5719)
Fixes TypeError: Cannot read properties of undefined (reading 'markedUnread')
that occurs in newer WhatsApp Web versions.

The sendSeen method was removed/changed in recent WhatsApp Web updates.
Using markSeen resolves the issue.

Fixes #5718

Co-authored-by: cp1797 <cp1797@users.noreply.github.com>
Co-authored-by: eltonnicolau <eltonnicolau@users.noreply.github.com>
Co-authored-by: telmedola <telmedola@users.noreply.github.com>
Co-authored-by: qw271862028 <qw271862028@users.noreply.github.com>
Co-authored-by: duola8789 <duola8789@users.noreply.github.com>
2026-01-19 15:54:31 +02:00
WWebJS Bot
0671463c21 chore(v1.34.5-alpha.3): bump version and generate docs 2026-01-05 05:54:48 +00:00
Pedro S Lopez
04c1d0c415 fix(ci): set up OIDC machine, avoid pushing incomplete version commits 2026-01-05 01:53:55 -04:00
WWebJS Bot
eb45d2eae4 chore(1.34.5-alpha.2): generate docs 2026-01-05 05:51:33 +00:00
WWebJS Bot
bf551fb497 1.34.5-alpha.2 2026-01-05 05:51:12 +00:00
WWebJS Bot
b5cf37a349 chore(1.34.5-alpha.1): generate docs 2026-01-05 05:42:04 +00:00
WWebJS Bot
eaaa2ecde2 1.34.5-alpha.1 2026-01-05 05:41:41 +00:00
Pedro S Lopez
c13510e907 chore: fix jsdoc invalid types 2026-01-05 01:40:46 -04:00
WWebJS Bot
180190a66a 1.34.5-alpha.0 2026-01-05 05:34:39 +00:00
Pedro S. Lopez
8d9130ec63
fix release script, use OIDC (#5713) 2026-01-05 01:34:03 -04:00
WWebJS Bot
f1cd985445 chore(): generate docs 2026-01-05 05:14:02 +00:00
WWebJS Bot
6c8286e4f2 1.34.4 2026-01-05 05:13:41 +00:00
BenyFilho
143662eae2
Fix Auth Timeout Error (#5666)
* Fix Auth Timeout Error

* fixing Auth Timeout Error
2025-12-15 10:41:15 +02:00