Issue Priority
Medium (should be fixed soon)
Issue Description
Calling WAWebChatLoadMessages.loadEarlierMsgs in the WhatsApp Web context (for example, from DevTools with a valid chat object) results in:
Uncaught TypeError: Cannot read properties of undefined (reading "waitForChatLoading")
The stack trace points to the internal bundle (loadEarlierMsgs → access to waitForChatLoading on an undefined value). This affects the flow where the library used loadEarlierMsgs to paginate messages when fetching with limit in Chat / Channel.
There is a proposed fix/refactor that replaces this path with WAWebDBMessageFindLocal.msgFindBefore: see PR below.
Steps To Reproduce
- Open an authenticated WhatsApp Web session (same environment used by Puppeteer / whatsapp-web.js).
- In DevTools (Console), obtain a chat reference (for example via internal collections or a variable already exposed in your debug session).
- Run:
await window.require("WAWebChatLoadMessages").loadEarlierMsgs(chat);
- Observe the
TypeError on waitForChatLoading.
Code Sample
// Minimal reproduction in WhatsApp Web console (with a valid `chat` in scope)
await window.require("WAWebChatLoadMessages").loadEarlierMsgs(chat);
WhatsApp Account Type
Standard
Authentication Strategy
LocalAuth
whatsapp-web.js Version
1.34.6
WhatsApp Web Version
(fill in with the output of await client.getWWebVersion() in your environment)
Browser Type
Chromium / Google Chrome
Browser Version
(exact browser version used in testing)
Computer OS Version
macOS (adjust if different)
Phone OS Version
(OS version of the phone linked to WhatsApp)
Node.js Version
(output of node -v in the project using the library)
Related Pull Request
Checklist
Issue Priority
Medium (should be fixed soon)
Issue Description
Calling
WAWebChatLoadMessages.loadEarlierMsgsin the WhatsApp Web context (for example, from DevTools with a validchatobject) results in:The stack trace points to the internal bundle (
loadEarlierMsgs→ access towaitForChatLoadingon anundefinedvalue). This affects the flow where the library usedloadEarlierMsgsto paginate messages when fetching withlimitinChat/Channel.There is a proposed fix/refactor that replaces this path with
WAWebDBMessageFindLocal.msgFindBefore: see PR below.Steps To Reproduce
TypeErroronwaitForChatLoading.Code Sample
WhatsApp Account Type
Standard
Authentication Strategy
LocalAuth
whatsapp-web.js Version
1.34.6
WhatsApp Web Version
(fill in with the output of
await client.getWWebVersion()in your environment)Browser Type
Chromium / Google Chrome
Browser Version
(exact browser version used in testing)
Computer OS Version
macOS (adjust if different)
Phone OS Version
(OS version of the phone linked to WhatsApp)
Node.js Version
(output of
node -vin the project using the library)Related Pull Request
Checklist