Repository navigation
fix(Utils): resolve getChats() CDP 'r: r' on WhatsApp Web 2.3000.x ($1 rename + fault-isolated getChatModel) - #201910
cripperzprodigy wants to merge 1 commit into
Conversation
- WhatsApp Web 2.3000.x renamed internal ID property `_serialized` to `$1` - Add `_serialized || $1` fallback chains across 9 crash sites in Injected/Utils.js - Add `__ensureSerializedIds` normalizer to ensure models returned across CDP guarantee `_serialized` - Add `__getChatModelSafe` fault-isolated chat resolution so one malformed/stale chat or revoked newsletter cannot fail the entire `getChats()`/`getChannels()` Promise.all batch - Wrap `groupMetadata.update()` and `newsletterMetadata.update()` in try/catch error boundaries
|
Is there anybody who has done it to get older messages smooth as it has been doing on the web? |
|
Confirmed on WhatsApp Web 2.3000.1047868043 (whatsapp-web.js 1.34.7, puppeteer 24.38.0, Chrome, Node 22). For the record, the underlying page-side error behind the minified i.e. an One robustness note on the for (const value of Object.values(key)) {
if (typeof value === 'string' && /^(true|false)_/.test(value)) return value;
}(as a last resort after |
… "r: r" - Rebuild trouxe o Chromium 154 do Debian e converteu o perfil do WhatsApp; fixado o Chrome 146.0.7680.31 (o que rodava até 15/10 e o mesmo do D90). - WhatsApp Web 2.3000.x renomeou _serialized para $1: toda mensagem falhava com "r: r". Aplicada a correção da PR wwebjs/whatsapp-web.js#201910 sobre a 1.34.7 (agora fixa no package.json). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017yLm1GdRee1EUUWwHLXtUM
Problem Description
On WhatsApp Web
2.3000.x(e.g.2.3000.1046738589), callingclient.getChats()consistently throws a minified CDP evaluation error:Root Causes
_serialized→$1): WhatsApp Web's minified bundler renamed internal WID and key object serialization properties from_serializedto$1. Insrc/util/Injected/Utils.js, calls like.createWid(chat.id._serialized)passundefined, throwing minifiedr: rexceptions inside#evaluate.Promise.allFail-Fast Trap:window.WWebJS.getChatsandwindow.WWebJS.getChannelsmap all chats throughgetChatModel()inside an unprotectedPromise.all. If an account is in multiple groups/channels and ANY single chat throws (e.g. stale group metadata, kicked from group, LID migration glitch intoPn, or revoked newsletter), the entiregetChats()batch rejects.Proposed Changes
_serialized || $1Fallbacks:Added fallback lookups across all 9 direct crash sites in
Injected/Utils.js(e.g.,chat.id._serialized || chat.id.$1).__ensureSerializedIdsModel Normalizer:Hooked a normalizer into
getMessageModel,getChatModel, andgetContactModelensuring that models returned across the CDP boundary into Node.js always guaranteeid._serialized.__getChatModelSafeFault-Tolerant Resolver:getChats()andgetChannels()through__getChatModelSafe: if metadata enrichment fails for an individual group or channel, it falls back to basic chat serialization (chat.serialize()) instead of rejecting the whole batch.groupMetadata.update()andnewsletterMetadata.update()intry/catcherror boundaries.results.filter(Boolean).Verification
2.3000.1046738589—getChats()successfully recovers offline message history without errors.