Skip to content

fix: unwrap edited messages during history sync parsing#246

Open
hiasinho wants to merge 2 commits into
openclaw:mainfrom
hiasinho:fix/history-edited-messages
Open

fix: unwrap edited messages during history sync parsing#246
hiasinho wants to merge 2 commits into
openclaw:mainfrom
hiasinho:fix/history-edited-messages

Conversation

@hiasinho
Copy link
Copy Markdown

Summary

  • Handle edited WhatsApp messages in the history/backfill parser
  • Unwrap both ProtocolMessage_MESSAGE_EDIT and top-level EditedMessage
  • Preserve the original target message ID from the protocol key where available
  • Add regression coverage for edited messages received through history sync

Fixes #245.

Behavior note

This fixes parsing for edited messages when they are received by wacli during future history sync, fresh initial sync, or backfill events.

It does not automatically repair existing rows already stored as:

text = NULL
display_text = "(message)"

Those rows need to be re-delivered by WhatsApp, for example through a fresh linked-device sync, before this parser fix can recover the edited body.

Testing

go test ./internal/wa ./internal/app ./internal/store ./cmd/wacli

Also tested against a fresh linked-device sync: edited messages that were previously stored as (message) were recovered with their text bodies.

@hiasinho
Copy link
Copy Markdown
Author

One possible follow-up to make this PR stronger: add regression assertions for the two edge cases handled here too — preserving wrapper MessageContextInfo when unwrapping top-level EditedMessage, and not overwriting FromMe when the protocol key omits it. I can add those if helpful.

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.

Edited messages from history/backfill are stored as "(message)" instead of unwrapping MESSAGE_EDIT

1 participant