feat(webhooks): add delivery status, event class, and event type filters#4931
feat(webhooks): add delivery status, event class, and event type filters#4931XyneSpaces wants to merge 1 commit into
Conversation
… event type Adds event_classes, event_types, and is_delivered filters to webhook events list. Wires filters to POST payload matching backend EventListConstraints schema. Adds WEBHOOK_EVENTS_FILTERS entity for fetching filter options. Maps delivery status UI values to backend boolean. Preserves existing date range and search by ID functionality. Refs: #3036
XyneSpaces
left a comment
There was a problem hiding this comment.
Review Summary
Classification: Feature Addition — Webhook Event Filters
Risk Level: Low-Medium
Files Changed: 4 files
Verification Against Control Center Checklist
Tier 1 — High Signal:
✅ Naming Consistency — Filter field names (event_classes, event_types, delivery_status) match backend API expectations
✅ Existing Utilities — Uses useGetMethod, InputFields.multiSelectInput, InputFields.singleSelectInput appropriately
✅ Error Handling — fetchFilterOptions has try-catch with silent failure (acceptable for filter options loading)
Findings
fetchFilterOptions
catch {
| _ => ()
}The catch block silently swallows all errors when fetching filter options. While non-critical (filters falling back to empty is acceptable), consider logging the error for debugging purposes.
Fix: Add error logging:
catch {
| err =>
logger::error("Failed to fetch webhook filter options", ~err)
()
}💡 mapDeliveryStatusToBackend could use variant instead of string
The current string-based mapping works, but using a ReScript variant would provide compile-time safety:
type deliveryStatus = Delivered | Failed | Unknown
let mapDeliveryStatusToBackend = (status: deliveryStatus) =>
switch status {
| Delivered => Some(true)
| Failed => Some(false)
| Unknown => None
}Not blocking — current implementation is functional.
Positive Notes
- Clean separation between UI delivery status strings and backend boolean
- Proper use of existing form/input components
- Feature flag
devClickhouseAggregateproperly respected - Good alignment with existing webhook screen patterns
Verdict: ✅ Approve — Clean feature addition with proper filter integration. Minor suggestion on error logging.
Automated Review: Webhook Filters FeatureClassification: UI Feature — Add delivery status, event class, and event type filters Verification SummaryTier 1 — High Signal:
Findingscatch {
| _ => ()
}The Fix: Add error handling to inform users: catch {
| _ => {
// Log error and show toast notification
logger->error("Failed to load webhook filter options")
showToast(~message="Failed to load filters", ~toastType=ToastError)
}
}🔍 Whitespace-only formatting change detected - }
+ }Line 1199 in Fix: Revert the indentation-only change on the closing brace. 💡 Consider caching filter options The Fix: Store fetched options in a global atom keyed by 🔍 Delivery status options hardcoded The delivery status options are hardcoded as Fix: Consider fetching these from the backend along with event classes/types, or document the assumption that these are the only two valid states. 💡 Missing empty state handling for empty arrays if eventClasses->Array.length > 0 {
payload->Dict.set("event_classes", eventClasses->JSON.Encode.array)
}This correctly omits empty arrays from the payload, but there's no visual indication to users that the dropdown is empty due to no data vs. still loading. Fix: Add a loading state to Positive Notes
Pre-existing IssuesNone identified in changed files. Verdict: |
Type of Change
Description
Adds three new filters to the webhook events list that were already supported by the backend API but missing in the control-center UI:
Changes Made
API Layer (
src/APIUtils/)WEBHOOK_EVENTS_FILTERSentity toAPIUtilsTypes.resevents/profile/filterGET endpoint inAPIUtils.resWebhook Events Screen (
src/screens/Developer/Webhooks/)/events/profile/listFilter Value Mapping
is_delivered: true, "failed" →is_delivered: falseevent_classes,event_types)Backend Support
Backend already supports these filters via
EventListConstraintsstruct incrates/api_models/src/webhook_events.rs:Testing
Closes
Closes #3036
Motivation and Context
Merchants need to filter webhook events by delivery status, event class, and event type to quickly find relevant events when debugging webhook delivery issues.
How did you test it?
npm run re:build)event_classes,event_types, andis_deliveredfields are sentWhere to test it?
Backend Dependency
Feature Flag