Skip to content

fix: add property fallback for WID objects and update loadEarlierMsg… - #201871

Open
Rajojha-1 wants to merge 1 commit into
wwebjs:mainfrom
Rajojha-1:fix/wid-serialized-dollar1-fallback
Open

fix: add property fallback for WID objects and update loadEarlierMsg…#201871
Rajojha-1 wants to merge 1 commit into
wwebjs:mainfrom
Rajojha-1:fix/wid-serialized-dollar1-fallback

Conversation

@Rajojha-1

@Rajojha-1 Rajojha-1 commented Jul 31, 2026

Copy link
Copy Markdown

Description

Fixes the minified r: r crash and TypeError when calling getChat(), getChatById(), or chat.fetchMessages().

WhatsApp Web's July 2026 update renamed internal WID serialized properties from _serialized to $1 and updated WAWebChatLoadMessages.loadEarlierMsgs parameter handling.

This PR:

  1. Adds Base._normalizeId(id) in src/structures/Base.js to ensure _serialized falls back to $1 without mutating original keys or breaking E2E decryption.
  2. Updates Message.js (from, to, author) and Utils.js (getMessageModel, getChat) to handle $1 property fallbacks.
  3. Updates Chat.prototype.fetchMessages to pass searchOptions into loadEarlierMsgs.

Related Issue(s)

fixes #201838
resolves #201849
resolves #201862
resolves #201869

Testing Summary

Test Details

  • Tested chat.fetchMessages({ limit: 50 }) on 1-on-1 contact chats and group chats.
  • Verified _serialized property fallback prevents r: r minified errors.
  • Verified historical messages load without throwing TypeError.

Environment

  • Machine OS: Windows 11
  • Phone OS: Android / iOS
  • Library Version: 1.34.7
  • WhatsApp Web Version: 2.3000.1017054665
  • Browser Type and Version: Chromium / Puppeteer
  • Node Version: v20.x

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • My code follows the style guidelines of this project.
  • All new and existing tests pass (npm test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api changes API modifications utility Utility code

Projects

None yet

1 participant