Skip to content

fix: Baileys 6.17 compat, getMessage retry, debug logging#84

Merged
gavrielc merged 3 commits into
mainfrom
whatsapp-fixes
Mar 28, 2026
Merged

fix: Baileys 6.17 compat, getMessage retry, debug logging#84
gavrielc merged 3 commits into
mainfrom
whatsapp-fixes

Conversation

@gavrielc

Copy link
Copy Markdown
Contributor

Summary

  • Baileys 6.17 compatibility: makeWASocket is now a named export (no longer default). proto loaded via createRequire since it's not statically analyzable as an ESM named export from the CJS module.
  • getMessage retry fix: Falls back to DB lookup (getMessageContentById) then empty proto.Message instead of undefined, fixing "waiting for this message" on self-chat retries.
  • Missing dependency: Added qrcode package for browser QR auth method.
  • Debug logging: Verbose message lifecycle logging (upsert, candidate, skip reasons with JIDs) for easier troubleshooting.
  • Group metadata: cachedGroupMetadata + LID→phone mapping via chats.phoneNumberShare event. Normalized group metadata for outbound sends.

Test plan

  • 41 WhatsApp tests pass
  • 286 total tests pass
  • Self-chat messages received and responded to
  • Group messages received and responded to
  • QR code and pairing code auth both work

🤖 Generated with Claude Code

- Named import for makeWASocket (default export removed in 6.17)
- proto loaded via createRequire (not statically analyzable as ESM export)
- getMessage falls back to DB lookup then empty proto.Message instead of
  undefined, fixing "waiting for this message" on self-chat retries
- Added qrcode dependency for browser QR auth method
- Verbose debug logging for message lifecycle (upsert, candidate, skip reasons)
- cachedGroupMetadata + LID phone mapping via chats.phoneNumberShare event
- Group metadata normalization for outbound sends (LID→phone in participants)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gavrielc gavrielc requested a review from gabi-simons as a code owner March 28, 2026 20:48
gavrielc and others added 2 commits March 28, 2026 23:52
Old 6.7.x can't decrypt messages with newer WhatsApp protocol,
causing "waiting for this message" on all received messages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removed verbose message lifecycle logging (upsert counts, candidate
descriptions, skip reasons, delivered details) that was added during
debugging. Kept functional changes only.

Added getMessageContentById to db.ts for getMessage retry fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gavrielc gavrielc merged commit 4a030ef into main Mar 28, 2026
1 check failed
@alanxp

alanxp commented Mar 29, 2026

Copy link
Copy Markdown

Not working, still get the "Waiting for this message"

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants