Skip to content

getChatById() fails for 100% of @lid contacts with "No LID for user" — not intermittent, survives full logout + re-pairing #201834

Description

@JhonyCreativo

Issue Description

client.getChatById(chatId) throws for every @lid contact on this account (confirmed across 12 different contacts), not just occasionally. The thrown error's name/message/stack are a single minified letter (e.g. r), consistent with the internal WAWebFindChatAction.findOrCreateLatestChat → toUserLidOrThrow "No LID for user" failure described in #3834, but here it's 100% reproducible rather than intermittent.

This breaks everything downstream that needs a resolved Chat object for an @lid id:

Interestingly, client.getContactLidAndPhone([chatId]) does resolve correctly for the same contacts, so the account clearly has a usable LID mapping somewhere — findOrCreateLatestChat specifically seems unable to use it.

Reproduction Steps

  1. Link a WhatsApp Business account whose contacts are mostly @lid (hidden-number privacy id) rather than @c.us.
  2. Call client.getChatById('@lid') for any of them.
  3. Observe it throws consistently (not once in a while — every single call, every single contact).

Code Sample

User Setup

WhatsApp Type
Account Type WhatsApp Business
Authentication Strategy LocalAuth
WhatsApp Web Version 2.3000.1043159177, 2.3000.1043179329
whatsapp-web.js Version 1.34.7
Environment Version
Browser Type Chromium
Browser Version 24.38.0
Phone OS Version IOS
Running OS Version Ubuntu
Node.js Version v20.19.6

Checklist

  • I use the latest released version of whatsapp-web.js.
  • I have searched existing issues and confirmed this is not a duplicate.
  • I have verified this is a library issue, not a problem with my code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokenissued lowLow impact issuetypingsType definitions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions