Commit fd95c53
committed
fix(getChat): resolve LID for unknown contacts via WAWebContactSyncUtils (wwebjs#3834)
When sendMessage is called for a contact not yet synced, findOrCreateLatestChat
fails with "No LID for user". This adds a third fallback in getChat that uses
WAWebContactSyncUtils.constructUsyncDeltaQuery to resolve the phone number to
a LID via WhatsApp servers, then retries findOrCreateLatestChat with the
resolved LID.
The fix preserves the existing behavior:
- 1st: fast in-memory cache lookup via Store.Chat.get()
- 2nd: async findOrCreateLatestChat with the original WID
- 3rd (new): LID resolution + retry (only when both above fail)1 parent 9ba93d6 commit fd95c53
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
584 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
585 | 603 | | |
586 | 604 | | |
587 | 605 | | |
| |||
0 commit comments