fix(whatsapp): ignore outbound echoes for inbound activity#79057
fix(whatsapp): ignore outbound echoes for inbound activity#79057mcaxtr merged 2 commits intoopenclaw:mainfrom
Conversation
f44426b to
d6b3476
Compare
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. The linked bug report gives a live current-main WhatsApp Web self-send reproduction, and source inspection confirms current main records inbound activity before the outbound-echo filter while channel status exposes that activity. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this PR or an equivalent narrow fix once the normal exact-head checks pass. Do we have a high-confidence way to reproduce the issue? Yes. The linked bug report gives a live current-main WhatsApp Web self-send reproduction, and source inspection confirms current main records inbound activity before the outbound-echo filter while channel status exposes that activity. Is this the best way to solve the issue? Yes. Moving the timestamp side effect to the accepted-inbound boundary is the narrow maintainable fix, and the latest diff also restores the required changelog coverage. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b1eedb2fc8a1. |
d6b3476 to
ec81a59
Compare
ec81a59 to
eb051e8
Compare
eb051e8 to
3b1f38a
Compare
|
Merged via squash.
Thanks @ai-hpc! |
Summary
openclaw channels status --probecould report fresh inbound activity after a Gateway-originated self-send even though no real inbound WhatsApp message was handled.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
channels statusreport fresh inbound activity #79056Real behavior proof (required for external PRs)
openclaw channels status --json, sent one WhatsApp message to the linked account's own E.164 number throughopenclaw message send --channel whatsapp --account default, waited, then capturedchannels status --jsonand redacted Gateway logs.{ "sendMessageId": "3EB0FE70141FB96653FA7A", "before": { "lastInboundAt": null, "lastOutboundAt": null, "connected": true, "healthState": "healthy" }, "after": { "lastInboundAt": null, "lastOutboundAt": "2026-05-07T17:55:58.765Z", "connected": true, "healthState": "healthy" }, "inboundAdvanced": false, "outboundAdvanced": true }Redacted matching logs after fix only showed the outbound send:
{ "sendMessageId": "3EB03B031C04B624AAEA9B", "before": { "lastInboundAt": "2026-05-07T17:18:40.619Z", "lastOutboundAt": "2026-05-07T17:18:40.517Z" }, "after": { "lastInboundAt": "2026-05-07T17:41:18.191Z", "lastOutboundAt": "2026-05-07T17:41:18.145Z" }, "inboundAdvanced": true, "outboundAdvanced": true }Root Cause (if applicable)
attachWebInboxToSocketrecorded inbound channel activity at the top of each WhatsAppmessages.upsertitem, beforenormalizeInboundMessagecould reject Gateway-originated outbound echoes via the recent outbound-message filter.channels statususes channel activity as fallback status metadata, so pre-filter raw WhatsApp Web events can leak into user-visible status even when the inbound message is later dropped.Regression Test Plan (if applicable)
extensions/whatsapp/src/monitor-inbox.behavior.test.tsUser-visible / Behavior Changes
openclaw channels status --probeno longer reports fresh WhatsApp inbound activity from a Gateway-originated outbound echo/self-send.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
defaultSteps
openclaw channels status --json.openclaw channels status --jsonagain.lastInboundAtandlastOutboundAt.Expected
lastOutboundAtadvances.lastInboundAtdoes not advance unless a real inbound WhatsApp message is handled.Actual
lastInboundAtandlastOutboundAtadvanced for the self-send echo.lastOutboundAtadvances.Evidence
Human Verification (required)
Review Conversations
Compatibility / Migration
Risks and Mitigations