Meta Cloud API: no MESSAGES_UPDATE for delivery statuses — TypeError reading 'name' when the status payload carries contacts without profile

Open Beginner friendly
#2,704 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
api, backend

Research direction

Start in src/api/integrations/channel/meta/whatsapp.business.service.ts around line 390, then follow the statuses handling later in messageHandle. Verify that status callbacks with contacts lacking profile no longer throw and that MESSAGES_UPDATE processing can complete for sent, delivered, and read events.

Written by the indexing model from the issue text.

Description

What happens

On the Meta Cloud API channel (whatsapp.business.service.ts), no MESSAGES_UPDATE webhook is ever
emitted for delivery statuses
. Every sent / delivered / read callback from Meta is logged and then
lost:

ERROR [ChannelStartupService] TypeError: Cannot read properties of undefined (reading 'name')
    at Ls.messageHandle (/evolution/dist/main.js:231:774)
    at Ls.eventHandler (/evolution/dist/main.js:231:9623)

Three of these per outgoing message (one per ack). Incoming messages are unaffected.

Cause

messageHandle reads the push name before anything else:

https://github.com/EvolutionAPI/evolution-api/blob/2.3.7/src/api/integrations/channel/meta/whatsapp.business.service.ts#L390

if (received.contacts) pushName = received.contacts[0].profile.name;

This assumes contacts only ever appears on an incoming-message event, where the entry does carry
profile.name. Meta's status callback now also carries a contacts array — but without profile, only
the recipient identity (the user_id that comes along with pricing_model: "PMP" / recipient_user_id):

{
  "messaging_product": "whatsapp",
  "metadata": { "display_phone_number": "<redacted>", "phone_number_id": "<redacted>" },
  "contacts": [ { "wa_id": "<redacted>", "user_id": "BR.<redacted>" } ],
  "statuses": [
    {
      "id": "wamid.<redacted>",
      "status": "delivered",
      "timestamp": "1787583812",
      "recipient_id": "<redacted>",
      "recipient_user_id": "BR.<redacted>",
      "pricing": { "billable": true, "pricing_model": "PMP", "category": "marketing", "type": "regular" }
    }
  ]
}

So received.contacts[0].profile is undefined, and reading .name throws. The if (received.statuses)
block that would emit MESSAGES_UPDATE sits ~350 lines further down inside the same try, so it is never
reached; the catch only logs. pushName is not used on the status path at all.

main and 2.4.0-rc2 still have the same unguarded line.

Suggested fix

-      if (received.contacts) pushName = received.contacts[0].profile.name;
+      if (received.contacts) pushName = received.contacts?.[0]?.profile?.name;

Happy to open a PR if that is welcome.

Steps to reproduce

  1. Meta Cloud API channel instance, messages field subscribed in the Meta app, MESSAGES_UPDATE in the
    instance webhook events, DATABASE_SAVE_DATA_NEW_MESSAGE=true.
  2. Send any message (template or plain text) through the instance.
  3. Meta posts the sent / delivered / read callbacks; each one logs the TypeError above and no
    MESSAGES_UPDATE webhook is delivered, nor is a MessageUpdate row written.

Environment

  • Evolution API 2.3.7 (Docker image evoapicloud/evolution-api:v2.3.7), Postgres + Redis
  • Channel: Meta Cloud API (WhatsApp Business Platform), Graph API official cloud
  • Observed 2026-08-24
Dominant language
TypeScript
Stars
9.6k
Forks
7.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from evolution-foundation/evolution-api

All issues in evolution-foundation/evolution-api

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.