feat(bridge): forward reaction webhook events#129
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds forwarding of inbound WhatsApp reaction events to the configured webhook endpoint as a typed webhook payload (eventType: "reaction"), while preserving the existing persistence semantics introduced in PR #108 (emoji in content, reacted-to message ID in filename / reactionToMessageId).
Changes:
- Extend the webhook payload schema to support typed reaction events (
eventType,reactionToMessageId,reactionEmoji,reactionRemoved) and add a dedicatedSendReactionWebhookhelper. - Update message handling to forward inbound reactions to the webhook (including empty-emoji removal events) while honoring
FORWARD_SELF. - Add tests validating reaction webhook forwarding behavior (add, removal, self-forwarding disabled, and “no key” ignored) and document the reaction webhook payload in the README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| whatsapp-bridge/webhook.go | Adds reaction-specific fields to the webhook payload and introduces SendReactionWebhook. |
| whatsapp-bridge/main.go | Forwards inbound reactions to the webhook after persisting them, respecting FORWARD_SELF. |
| whatsapp-bridge/main_test.go | Adds end-to-end tests ensuring reaction webhook forwarding works for add/remove and respects forward/self and missing-key behavior. |
| README.md | Documents the typed reaction webhook payload shape and removal semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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
WEBHOOK_URLas typedeventType: "reaction"webhook payloads.content, target message ID stays infilename/reactionToMessageId.Behavior
reactionEmojiandcontentcontain the emoji,reactionRemoved: false.reactionEmojiandcontentare empty strings,reactionRemoved: true.FORWARD_SELFsetting.Tests
cd whatsapp-bridge && go test -count=1 ./...cd whatsapp-bridge && golangci-lint rungit diff --checkReaction webhook received; no normal assistant reply path was triggered.Companion