Skip to content

feat(events): delivery channels and coalesced webhook deliveries - #14

Merged
albanm merged 4 commits into
mainfrom
feat-event-channels
Sep 23, 2026
Merged

albanm merged 4 commits into
mainfrom
feat-event-channels

Conversation

@albanm

@albanm albanm commented Sep 23, 2026

Copy link
Copy Markdown
Member

Events can now limit where they are delivered, and can coalesce their webhook deliveries.

  • channels (events, notifications, webhooks, all by default) selects which of the three channels an event goes to: stored event history, subscriber notifications, webhook deliveries. channels and coalesce are delivery instructions and are not stored on the event.
  • coalesce: true rewrites the queued delivery for the same webhook subscription and topic key instead of adding another one. A waiting delivery is picked first, then a retrying one (its backoff is kept), then a completed one (reset to waiting). A delivery already being sent is left alone and a new one is queued.
  • Fix: nextAttempt is now stored as an ISO string. The worker compares it with an ISO string, so failed webhooks were never retried before.
  • Bumps @data-fair/lib-common-types to ^1.24.0 for the new event fields.

Why: high-frequency signals flooded webhook deliveries and event storage, and failed webhooks were never retried.

Heads-up: error webhooks written before this change still have a Date nextAttempt. The worker will never retry them, and a coalesced event writes into them because they look like they are retrying. A one-off migration (convert them to ISO strings, or reset them) may be needed.

albanm and others added 4 commits September 23, 2026 11:59
…are retried

The worker compared a stored Date with an ISO string, which never matches in
mongo: a failed webhook was never attempted again. Also adds the pure
coalescing decision used by the next commit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
An event can now be restricted to some of its channels (stored events,
subscriber notifications, webhooks). A coalesced event replaces the pending
delivery for the same webhook subscription and topic key instead of queuing
another, which bounds storage for high-frequency signals.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A delivery that completed while a newer one was queued was picked first
and reset, leaving two pending deliveries for the same subscription and
topic, or restarting the backoff of a failing endpoint.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@albanm
albanm merged commit e7a9b96 into main Sep 23, 2026
4 checks passed
@albanm
albanm deleted the feat-event-channels branch September 23, 2026 13:44
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