-
Notifications
You must be signed in to change notification settings - Fork 559
chore: webhook payload must be an array #7444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: webhook payload must be an array #7444
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 9f8552d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe changes update the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant WebhookEventProducer
Caller->>WebhookEventProducer: sendEvents(events)
loop For each event
WebhookEventProducer->>WebhookEventProducer: Assert event.payload is a non-empty array
alt Payload is empty
WebhookEventProducer-->>Caller: Throw error
else Payload is valid
WebhookEventProducer->>WebhookEventProducer: Proceed with validation and sending
end
end
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)`**/*.@(ts|tsx)`: Accept a typed 'props' object and export a named function (e.g...
📄 Source: CodeRabbit Inference Engine (.cursor/rules/dashboard.mdc) List of files the instruction was applied to:
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (3)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7444 +/- ##
=======================================
Coverage 51.92% 51.92%
=======================================
Files 947 947
Lines 63875 63875
Branches 4214 4214
=======================================
Hits 33166 33166
Misses 30603 30603
Partials 106 106
🚀 New features to boost your workflow:
|
size-limit report 📦
|
[SDK] Fix: Require webhook payload to be an array
Notes for the reviewer
This PR updates the webhook event payload type to be an array of records instead of a single record. It also adds validation to ensure the payload array is not empty.
How to test
Verify that webhook events with empty payloads are rejected, and that the type definition correctly requires an array of records.
PR-Codex overview
This PR focuses on enforcing that the
payload
in webhook events must be an array and cannot be empty, enhancing the validation of webhook data.Detailed summary
createdAt
property in theWebhookEvent
interface to be optional.payload
property to be an array ofRecord<string, unknown>
and added a requirement that it must not be empty.sendEvents
method to check thatpayload
length is greater than 0.Summary by CodeRabbit
Chores
New Features