Skip to content

fix(zalo): log and drop messages with no content instead of throwing - #1646

Merged
sung17 merged 1 commit into
mainfrom
fix/zalo-no-content-log
Nov 4, 2026
Merged

sung17 merged 1 commit into
mainfrom
fix/zalo-no-content-log

Conversation

@sung17

@sung17 sung17 commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Zalo sends some events (e.g. oa_send_template) with no text and no attachment. getMessageEntity threw ZaloException: No content found in message …, failing the incomingMessage job and adding noise to error tracking for something that is not a code bug.

Now it logs one warning line (Zalo message has no content: <event_name>) and returns null, which receiveMessage already uses to skip invalid messages (same as missing sender/recipient). Missing msg_id still throws, since that is malformed data.

Changes

  • integrations/zalo/src/handlers/message/incoming-message/index.ts: getMessageEntity returns null + logger.warn instead of throwing; receiveMessage returns null in that case.
  • integrations/zalo/__tests__/incoming-gif-message.test.ts: the GIF-download-failed case now expects null instead of a throw.

Test plan

  • tsc --noEmit in integrations/zalo
  • vitest run in integrations/zalo: 16 files, 74 tests passed
  • pre-commit hook (ultracite + typecheck) passed

🤖 Generated with Claude Code

Zalo sends some events (e.g. oa_send_template) with no text or attachment. Throwing failed the incomingMessage job for a non-code issue; log one warning line and skip the message instead.

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 4, 2026
@sung17
sung17 merged commit 5708de4 into main Nov 4, 2026
15 checks passed
sung17 added a commit that referenced this pull request Nov 10, 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]>
hello-jackytruong referenced this pull request in hello-jackytruong/ChatWorkAI Nov 22, 2026
…(#1646)

Zalo sends some events (e.g. oa_send_template) with no text or attachment. Throwing failed the incomingMessage job for a non-code issue; log one warning line and skip the message instead.

Co-authored-by: Deathgiver <[email protected]>
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]>
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