Skip to content

fix(baileys): extract location and history content from ephemeral-wrapped messages#596

Merged
rmyndharis merged 1 commit into
mainfrom
fix/baileys-inbound-extraction
Jul 2, 2026
Merged

fix(baileys): extract location and history content from ephemeral-wrapped messages#596
rmyndharis merged 1 commit into
mainfrom
fix/baileys-inbound-extraction

Conversation

@rmyndharis

Copy link
Copy Markdown
Owner

Summary

Two Baileys inbound-extraction gaps for ephemeral (disappearing-chat) and other wrapped messages.

Changes

  • Ephemeral location coordinates were dropped. Live location extraction read content.locationMessage off the raw message, but a disappearing-chat location nests under the wrapper, so the raw field was undefined and the coordinates were lost. It now reads off the normalized (unwrapped) content, matching how the media path already works.
  • History-sync missed wrapped messages. mapHistoryMessage took the raw top-level key as the type and read the body off raw fields, so an ephemeral/viewOnce-wrapped history message mapped to type unknown with an empty body. It now normalizes the content first (unwrapping ephemeral/viewOnce/documentWithCaption/edited), derives one content type for both the skip-filter and the type mapping, and reuses extractBaileysBody — the same extraction the live path uses. captureHistoryMessages loads the lib once and passes it down.

Verification

npm run build ✓ · npm test ✓ (1865/1865, +2) · lint ✓. New tests: an ephemeral location message surfaces its coordinates; an ephemeral-wrapped history message maps to its real type/body.

…ed messages

- Read inbound location coordinates off the normalized (unwrapped) content instead of the raw message,
  so an ephemeral/disappearing-chat location no longer drops its coordinates.
- Normalize history-sync messages before mapping: unwrap ephemeral/viewOnce/documentWithCaption/edited
  wrappers so a disappearing-chat history message maps to its real type and body via extractBaileysBody,
  instead of type 'unknown' with an empty body. captureHistoryMessages now loads the lib once and passes
  it down.
@rmyndharis rmyndharis merged commit f51345a into main Jul 2, 2026
2 of 3 checks passed
@rmyndharis rmyndharis deleted the fix/baileys-inbound-extraction branch July 2, 2026 13:57
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.

1 participant