3 Commits

Author SHA1 Message Date
isra el
f65af5003b fix: give every webhook its own signing secret
The create dialog is mounted for the whole session, so its
defaultValues, and the uuid inside them, were evaluated exactly once.
A bare form.reset() then restored that same object, so every webhook
created without reloading the page shared one signing secret.

The secret is what proves a delivery genuinely came from us, so sharing
it across endpoints means compromising any one of them compromises the
rest.

Build the defaults fresh on each use, and reset with a new secret both
when the dialog opens and after a successful create.

The e2e guard was confirmed to fail against the previous code, with
both creates submitting an identical secret.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:42:17 +03:00
isra el
516e626213 feat: webhooks page owns subscriptions + deliveries subroutes
- webhooks/layout.tsx: section header + route tabs (Webhooks | Deliveries),
  fixing the page that was previously titled "Webhook Notification Delivery
  History" inside a component named MessagingPage
- /dashboard/webhooks now shows subscription management (WebhooksSection,
  moved off the dashboard home); /dashboard/webhooks/deliveries shows the
  delivery history
- webhooks-section slims down: the layout owns the title and the Deliveries
  view, so its header is now just count + Create button; drops the unused
  router/icon imports
- webhooks e2e rewritten for the two subroutes including a deliveries
  deep-link refresh-survival test

Build, 25 unit tests, and 13 e2e green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 07:36:25 +03:00
isra el
2623118df3 refactor: decompose 578-line webhooks-history into focused modules
Split app/(app)/dashboard/(components)/webhooks-history.tsx into a
webhooks-history/ folder (import path unchanged via index.tsx):

- use-filters.ts: filter state hook (device, webhook, event, status, preset
  and custom date ranges) with page reset handled in one place
- filters.tsx: the five filter selects + custom-range popover, deduplicated
  via a FilterField wrapper and option tables
- index.tsx: slim container on new useWebhooks / useWebhookNotifications
  hooks in lib/api
- promote the numbered pagination (previously duplicated verbatim between
  message-history and webhooks-history) to
  components/shared/numbered-pagination.tsx
- drop dead code: empty useEffect, never-set isLoading state, ~10 unused
  imports; replace the off-palette sky gradient with card tokens
- add a webhooks history e2e guard

Build, 25 unit tests, and 6 e2e green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 06:45:22 +03:00