Repository navigation
fix(zalo): drop webhook events without a message instead of failing the job - #1657
Merged
Merged
Conversation
…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]>
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Integration worker jobs fail with:
The Zalo webhook handler sends every event that has
sender/recipientto theincomingMessagequeue, except tag, (un)follow,user_received_messageanduser_seen_message.event_namealso accepts any string (.or(z.string())). An event with nomessagefield (e.g.user_submit_info, or an event name Zalo adds later) therefore reaches the ZaloreceiveMessageparser. The parser returnsnullfor it, and the worker throws on every retry.Zalo is the only channel parser that returns
nullfromreceiveMessage, so it is the only channel that can produce this error.Fix
integrations/zalo/src/handlers/webhook.ts: before enqueueingincomingMessage, ack and drop any event withoutmessage, and log itsevent_nameat info level so we can add support for it later if needed. This matches howuser_received_messageis already handled.Tests
integrations/zalo/__tests__/webhook-routing.test.ts: new cases foruser_submit_infoand an unknown event name, each with nomessage. The handler returnsokand 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) andpnpm lintall pass.🤖 Generated with Claude Code