Skip to content

fix: add error handling to WhatsApp messages.upsert handler#528

Closed
glifocat wants to merge 1 commit intoqwibitai:mainfrom
glifocat:fix/messages-upsert-error-handling
Closed

fix: add error handling to WhatsApp messages.upsert handler#528
glifocat wants to merge 1 commit intoqwibitai:mainfrom
glifocat:fix/messages-upsert-error-handling

Conversation

@glifocat
Copy link
Copy Markdown
Collaborator

Type of Change

  • Skill - adds a new skill in .claude/skills/
  • Fix - bug fix or security fix to source code
  • Simplification - reduces or simplifies source code

Description

Wrap the for-loop body in the messages.upsert event handler with try-catch to prevent a single malformed message from crashing processing of the entire batch. Errors are logged with the remoteJid for debugging.

Without this, any unexpected message shape (e.g. a missing field, a new WhatsApp protocol message type) causes an unhandled exception that silently stops all message processing until the next reconnect.

Wrap the for-loop body in the messages.upsert event handler with
try-catch to prevent a single malformed message from crashing
processing of the entire batch. Errors are logged with the
remoteJid for debugging.

Without this, any unexpected message shape (e.g. a missing field,
a new WhatsApp protocol message type) causes an unhandled exception
that silently stops all message processing until the next reconnect.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@glifocat glifocat force-pushed the fix/messages-upsert-error-handling branch from face4f8 to 6a80a7c Compare March 1, 2026 18:29
@glifocat
Copy link
Copy Markdown
Collaborator Author

glifocat commented Mar 4, 2026

Superseded by #695 (rebased to post-#500 skill architecture).

@glifocat glifocat closed this Mar 4, 2026
@glifocat glifocat deleted the fix/messages-upsert-error-handling branch March 4, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant