fix(whatsapp): notify user when trailing media send fails instead of silent drop#93334
Conversation
…silent drop When a multi-media reply contains more than one attachment and a non-first send fails, the onError callback returned early without notifying the user. The error was logged server-side only; from the recipient's perspective the attachment simply never arrived. Replace the silent return with a brief text fallback so the user knows the attachment was unavailable. Co-Authored-By: Dr Rushindra Sinha <5796457+rushindrasinha@users.noreply.github.com>
|
Codex review: needs maintainer review before merge. Reviewed June 15, 2026, 11:54 AM ET / 15:54 UTC. Summary PR surface: Source +9, Tests +41. Total +50 across 2 files. Reproducibility: yes. Current main has a clear source path: a multi-media WhatsApp reply whose non-first media send fails enters Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the focused WhatsApp-plugin fallback after normal maintainer review and required checks, keeping the shared media helper channel-agnostic. Do we have a high-confidence way to reproduce the issue? Yes. Current main has a clear source path: a multi-media WhatsApp reply whose non-first media send fails enters Is this the best way to solve the issue? Yes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 794bd89fa030. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +9, Tests +41. Total +50 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
vincentkoc
left a comment
There was a problem hiding this comment.
Reviewed live state, focused WhatsApp delivery diff, and green checks. The fallback notification is scoped and covered by regression tests.
Problem
When a reply contains multiple media attachments and a non-first send fails, the
onErrorcallback indeliver-reply.tsreturns early without any user notification:The error is logged server-side only. The recipient sees the first media attachment (or its text fallback) but the second, third, etc. simply never arrive with no indication of failure.
Fix
Replace the silent
returnwith a brief text reply so the user knows the attachment was unavailable:Test
Added
deliver-reply.test.ts: "notifies user when a non-first media send fails instead of dropping silently"Sets up two-media reply where first send succeeds and second fails (non-retryable error). Asserts
replyis called exactly once with"⚠️ Media unavailable".All 29
deliver-replytests pass.Observed on a production deployment where multi-attachment replies occasionally lost trailing attachments without any visible error to the recipient.
Real behavior proof
deliverWebReply, when a reply has multiple media attachments and a non-first send fails, theonErrorcallback returned early with no user notification — the recipient silently never received the trailing attachment(s).deliverWebReplyfrom this branch vianode --import tsx, loading two real local image files through the realloadWebMediapath (files placed under the allowed local root/tmp/openclaw).sendMediaaccepts the first send and rejects the second (trailing) send with an upload error, then invoked delivery:node --import tsx proof-media.mts⚠️ Media unavailable.reply instead of returning silently. The raw error string (upload failed) was kept server-side only and not leaked to the user.platform.sendMedia) so the realdeliverWebReplyerror-handling branch executed end to end.