Skip to content

[webhooks] batch event#59

Open
capcom6 wants to merge 1 commit into
masterfrom
webhooks/batch-events
Open

[webhooks] batch event#59
capcom6 wants to merge 1 commit into
masterfrom
webhooks/batch-events

Conversation

@capcom6

@capcom6 capcom6 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added support for batch webhook events for SMS and MMS, including new event types and payload formats.
    • Introduced webhook delivery modes for inbox refresh requests, with support for individual, batch, or disabled delivery.
  • Bug Fixes

    • Improved webhook validation so the newly supported batch event strings are accepted.
    • Added logic to determine the effective webhook delivery mode when older settings are used.
  • Tests

    • Added coverage for webhook delivery mode resolution across several input combinations.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7432c3b-f394-4bd7-9146-04abc2567969

📥 Commits

Reviewing files that changed from the base of the PR and between 9b7f395 and d8009c4.

📒 Files selected for processing (4)
  • smsgateway/domain_webhooks.go
  • smsgateway/dto_webhooks.go
  • smsgateway/requests_inbox.go
  • smsgateway/requests_inbox_test.go

📝 Walkthrough

Walkthrough

This PR adds new WebhookEvent constants for SMS/MMS batch events and registers them in the webhook event validation list, introduces corresponding batch payload DTO structs, and adds a WebhookDelivery type with an InboxRefreshRequest field and resolution method, along with accompanying tests.

Changes

Batch Webhooks and Delivery Mode

Layer / File(s) Summary
Batch webhook event constants and validation
smsgateway/domain_webhooks.go
Adds WebhookEventSmsBatchReceived, WebhookEventSmsBatchDataReceived, WebhookEventMmsBatchReceived, WebhookEventMmsBatchDownloaded constants and registers them in webhookEventTypes, expanding allEventTypes used by IsValidWebhookEvent.
Batch payload DTOs
smsgateway/dto_webhooks.go
Adds SmsBatchReceivedPayload, SmsBatchDataReceivedPayload, MmsBatchReceivedPayload, MmsBatchDownloadedPayload structs, each wrapping a Messages slice of the corresponding single-message payload type.
WebhookDelivery mode and resolution logic
smsgateway/requests_inbox.go, smsgateway/requests_inbox_test.go
Adds WebhookDelivery type and WebhookDeliveryDisabled/Individual/Batch constants, adds optional WebhookDelivery field to InboxRefreshRequest (deprecating TriggerWebhooks), adds ResolveWebhookDelivery() method, and adds table-driven tests covering all resolution combinations.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

  • android-sms-gateway/client-go#26: Both PRs extend smsgateway/domain_webhooks.go by adding new WebhookEvent constants and registering them in the shared valid-event lookup used for webhook event validation.
  • android-sms-gateway/client-go#35: Both PRs extend smsgateway/domain_webhooks.go with new webhook event constants and update the event-type slice used by validation logic.
  • android-sms-gateway/client-go#48: This PR's batch payload DTOs in smsgateway/dto_webhooks.go build directly on the single-event payload types added in the related PR.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is related to the main change because the PR adds webhook batch event support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
smsgateway/domain_webhooks.go 100.00% <ø> (ø)
smsgateway/requests_inbox.go 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@capcom6

capcom6 commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@capcom6

capcom6 commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@capcom6

capcom6 commented Jul 4, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@capcom6

capcom6 commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@capcom6 capcom6 force-pushed the webhooks/batch-events branch 2 times, most recently from 490b462 to d989c3b Compare July 7, 2026 04:36
@capcom6

capcom6 commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 54 minutes.

@capcom6

capcom6 commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 15 minutes.

@capcom6 capcom6 force-pushed the webhooks/batch-events branch from d989c3b to d8009c4 Compare July 8, 2026 01:27
@capcom6

capcom6 commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes.

@capcom6

capcom6 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@capcom6 capcom6 added the ready label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant