docs: outbound webhooks design (#562) - #569
Open
mahesh-sangawar wants to merge 2 commits into
Open
mahesh-sangawar wants to merge 2 commits into
mahesh-sangawar wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Design document for #562, following the repo's
docs/superpowers/specs/convention.No code. This records the decisions and, more importantly, why the cheaper alternatives were rejected — so a later reader doesn't assume they were overlooked.
The shape of it
The expensive half already exists.
outbox_eventsis a transactional outbox carrying 18 real domain events, drained by an in-process publisher withFOR UPDATE SKIP LOCKED. Webhooks consume that stream rather than instrumenting anything new, which is what makes this contained rather than the multi-week build it first looked like.Two loops and one new table, running in-process beside the existing publisher:
Decisions recorded
Two things worth a reviewer's attention
Decision 5 is a plan-entitlement change, not a webhook change. It alters what Studio sells and needs matching pricing copy on both public surfaces. It wants its own issue and must land before or with this.
Deliberately not extending the existing outbox publisher. Fanning out inside
ProcessBatchwould give exactly-once for free, but welds unbounded-latency network work into the watermark publisher — the componentoutbox/models.godocuments (#336) as subtle to recover from. A merchant's dead endpoint must never stall internal bookkeeping. Idempotency on(outbox_event_id, subscription_id)recovers the guarantee.The in-process placement is called out as reversible: the fan-out table already decouples dispatch from delivery, so extracting the worker later is a deployment change, not a redesign.
Also flagged
pricing-surfaces-truth.spec.tscurrently fails on any pricing surface mentioning webhooks. When this ships that guard should be narrowed, not deleted, so the custom-code-injection half stays pinned.Custom code injection remains explicitly out of scope.