Repository navigation
fix(worker): skip incoming messages with no storable content instead of failing - #1684
Merged
Merged
Conversation
…of failing A channel parser returns null for a webhook event with nothing to store (e.g. a Zalo oa_send_template with no text or attachment, since #1646). receiveMessage then threw "Unable to parse received message", so the incomingMessage job still failed and retried for a non-code issue. Log a warning with the integration type and inbox, and return null; both callers already treat null as "nothing to do". Co-Authored-By: Claude Opus 5.5 <[email protected]>
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
…of failing (#1684) A channel parser returns null for a webhook event with nothing to store (e.g. a Zalo oa_send_template with no text or attachment, since #1646). receiveMessage then threw "Unable to parse received message", so the incomingMessage job still failed and retried for a non-code issue. Log a warning with the integration type and inbox, and return null; both callers already treat null as "nothing to do". 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.
Summary
Production worker logs show repeated failures:
A channel's
receiveMessageparser returnsnullwhen a webhook event has nothing to store. Since #1646, Zalo does this on purpose for events with no text or attachment (e.g.oa_send_template, or a media message whose download failed). But the worker still threw onnull, so #1646 only moved the throw: theincomingMessagejob kept failing and retrying for a non-code issue.Change
apps/worker/src/integration/handlers/received-message.ts: when the parser returnsnull, log a warning (integrationType,inboxId,workspaceId) and returnnullinstead of throwing. Both callers (integration/worker.tsandthread-control.ts) already treatnullas "nothing to do".nullparse result resolves tonulland writes no contact, message or event.Verification
vitest run __tests__/received-message.test.ts: 224 passedpnpm --filter worker check-types: passespnpm lint: passes🤖 Generated with Claude Code