Skip to content

fix(zalo): drop webhook events without a message instead of failing the job - #1657

Merged
sung17 merged 1 commit into
mainfrom
fix/zalo-drop-non-message-events
Nov 6, 2026
Merged

sung17 merged 1 commit into
mainfrom
fix/zalo-drop-non-message-events

Conversation

@sung17

@sung17 sung17 commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

Integration worker jobs fail with:

SdkException: Unable to parse received message
    at receiveMessage (apps/worker/src/integration/handlers/received-message.ts:362:11)

The Zalo webhook handler sends every event that has sender/recipient to the incomingMessage queue, except tag, (un)follow, user_received_message and user_seen_message. event_name also accepts any string (.or(z.string())). An event with no message field (e.g. user_submit_info, or an event name Zalo adds later) therefore reaches the Zalo receiveMessage parser. The parser returns null for it, and the worker throws on every retry.

Zalo is the only channel parser that returns null from receiveMessage, so it is the only channel that can produce this error.

Fix

integrations/zalo/src/handlers/webhook.ts: before enqueueing incomingMessage, ack and drop any event without message, and log its event_name at info level so we can add support for it later if needed. This matches how user_received_message is already handled.

Tests

  • integrations/zalo/__tests__/webhook-routing.test.ts: new cases for user_submit_info and an unknown event name, each with no message. The handler returns ok and enqueues nothing. Existing routing cases still pass.
  • vitest (Zalo webhook/follow/tag suites, 23 tests), check-types (pre-commit hook: zalo, worker, builder and dependents) and pnpm lint all pass.

🤖 Generated with Claude Code

…he job

Zalo events that carry sender/recipient but no `message` (e.g.
`user_submit_info`, or an event name Zalo adds later) were routed to the
incomingMessage queue. The Zalo parser returns null for them, so the worker
threw "Unable to parse received message" on every retry. Ack and drop them
in the webhook handler, logging the event name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the bug Something isn't working as expected label Nov 5, 2026
@sung17
sung17 merged commit f8975e6 into main Nov 6, 2026
15 checks passed
hello-jackytruong referenced this pull request in hello-jackytruong/ChatWorkAI Nov 22, 2026
…he job (#1657)

Zalo events that carry sender/recipient but no `message` (e.g.
`user_submit_info`, or an event name Zalo adds later) were routed to the
incomingMessage queue. The Zalo parser returns null for them, so the worker
threw "Unable to parse received message" on every retry. Ack and drop them
in the webhook handler, logging the event name.

Co-authored-by: Deathgiver <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant