Repository navigation
feat(data-sharing): schema, capture triggers and delivery queue for outbound webhooks (1/4) - #546
Conversation
…utbound webhooks Database half of user-configurable data sharing (FLAME+): a user registers HTTPS endpoints and the portal pushes their own data there as signed events. Inert on its own: with no endpoint row every capture trigger returns at once and the delivery cron job is created inactive. - webhook_endpoints (owner SELECT, server-written), webhook_endpoint_secrets (service-only ciphertext) and webhook_deliveries (outbox + log). A composite FK ties every delivery to its endpoint's owner (FP-1). - Statement-level capture triggers on every shared table, driven by private.webhook_entity_sources, so both LWW paths, the push transaction, portal writes and RPCs are covered by one mechanism. A capture error is a WARNING, never an aborted sync write (FP-3). - Service-role RPCs: create/rotate/set-header, a FOR UPDATE SKIP LOCKED claim that pauses endpoints whose owner dropped below FLAME (FP-2), completion with backoff and auto-disable (FP-8), and a backfill. - Not shared: raw telemetry, INFERNO-gated biomechanics, Strava-sourced activities, community rows, billing and sync bookkeeping. Every manifest table is classified in _shared/dataSharingScopes.ts and a test fails when a new one is not. - Registered in the user-data manifest (secrets EXCLUDED), the RLS isolation suite and generated types; pgTAP floor raised. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…on race - pgTAP: with the outbox made to reject the row, the user's write must still succeed (FP-3). Verified to fail when the trigger's exception handler is removed. - complete_webhook_delivery: a pending row committed between the superseded check and the reschedule no longer surfaces as a unique violation; the attempt is closed as superseded. - Raise PGTAP_TEST_FLOOR to the suite's actual count. - Operator note on trigger lock contention. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
phoenix-portal | be4e9cc | Commit Preview URL Branch Preview URL |
Nov 06 2026, 06:43 PM |
| # Minimum aggregate Tests= for the suite. Raise this when | ||
| # assertions are added. | ||
| PGTAP_TEST_FLOOR: "2059" | ||
| PGTAP_TEST_FLOOR: "2246" |
There was a problem hiding this comment.
CRITICAL: pgTAP floor jumps +187 while this PR only adds 110 assertions
The gate fails when the suite's Tests= count is lower than PGTAP_TEST_FLOOR (migrations.yml:202), so the floor must never exceed the real count. This PR adds 83 assertions in webhook_data_sharing.test.sql plus 27 from the three new rls_cases rows in rls_isolation.test.sql (3 rows x 9 per-row probes: RLS enabled, fixture exists, owner-select or service-only, 3 B probes, 3 anon probes). That is +110 over the old floor of 2059, so the expected post-merge total is about 2169 - not 2246.
The old floor has tracked the suite's actual count exactly (275312e raised it by precisely the one assertion it added; 4691dcc changed no assertion count), so 2059 + 110 = 2169 < 2246 and this step exits 1.
Read the Tests= line from this branch's CI log and set the floor to that number, and keep each bump equal to the assertions that commit adds.
| userColumn: "user_id", | ||
| children: [ | ||
| { table: "exercises", parent: "workout_sessions", fkColumn: "session_id" }, | ||
| { table: "sets", parent: "exercises", fkColumn: "exercise_id" }, |
There was a problem hiding this comment.
WARNING: sets and rep_summaries are payload children with no capture source
private.webhook_entity_sources in the migration has rows for exercises, routine_exercises and cycle_days, but none for sets or rep_summaries, so the trigger loop creates no capture trigger on them. A write that touches only a set or a rep summary enqueues nothing, while the scope copy above promises "Sessions with their exercises, sets and rep summaries" and the payload builder (PR 3) will read those tables. The new pgTAP file's own header claims FP-3 covers "child-only edits".
Note the one-hop parent model cannot express sets -> exercises -> workout_sessions as it stands: the trigger writes entity_id = c.<id_column> and joins p.id = c.<id_column>, so a sets row would enqueue the exercise id as the workout id. Either give webhook_entity_sources an explicit root path so sets/rep_summaries resolve up to workout_sessions.id, or drop both tables from children and from the scope description - and add the reverse parity assertion (see the test finding).
| CONTINUE; | ||
| END IF; | ||
|
|
||
| v_args := pg_catalog.format('%L, %L, %L, %L, %L, %L', |
There was a problem hiding this comment.
WARNING: The capture triggers snapshot the source row into TG_ARGV, so the table and the triggers can drift
TG_ARGV is frozen at CREATE TRIGGER time, so private.webhook_entity_sources is only the source of truth for enqueue_webhook_backfill. The seed's own ON CONFLICT (source_table) DO UPDATE (line 290) invites a later migration to edit a row - for example to tighten the Strava exclusion - and that edit would reach the backfill but not the triggers. The migration header at lines 23-25 claims "the two cannot drift", which this snapshot does not guarantee.
The trigger function is already SECURITY DEFINER, so it can read the table as its owner. Look the row up with WHERE source_table = TG_TABLE_NAME at run time instead of passing six arguments, and drop v_args from this DO block; then the table is the only registry and the drift disappears.
| PERFORM pg_catalog.pg_advisory_xact_lock( | ||
| pg_catalog.hashtextextended('webhook_endpoints:' || p_user_id::text, 0)); | ||
|
|
||
| IF (SELECT count(*) FROM public.webhook_endpoints e WHERE e.user_id = p_user_id) |
There was a problem hiding this comment.
WARNING: The 3-endpoint limit counts disabled and paused endpoints, and nothing here removes one
complete_webhook_delivery switches an endpoint to disabled (too_many_failures / endpoint_gone) and claim_webhook_deliveries switches it to paused (subscription_lapsed), but both rows keep counting toward this limit, and this migration ships no delete/unregister RPC. A user who trips the auto-disable three times can never register another endpoint, and the FP-8 path is exactly what pushes users there.
Either count only the endpoints the user can still use (status = 'active'), or add a delete RPC here so a disabled endpoint stops consuming a slot.
| v_sql text; | ||
| BEGIN | ||
| -- Nobody shares this scope: cost one indexed probe and leave. | ||
| IF NOT EXISTS ( |
There was a problem hiding this comment.
SUGGESTION: The "indexed probe" is a sequential scan on the hottest write path
status = 'active' AND c_scope = ANY (e.scopes) is not supported by any index - the only index on webhook_endpoints is on (user_id). Every INSERT/UPDATE/DELETE on every shared table therefore seq-scans the endpoint table, and the comment's "cost one indexed probe" is not accurate.
Add a partial GIN index on scopes (WHERE status = 'active') if the endpoint count grows, or keep the comment honest.
| REFERENCES public.webhook_endpoints (id, user_id) ON DELETE CASCADE | ||
| ); | ||
|
|
||
| ALTER TABLE public.webhook_endpoint_secrets ENABLE ROW LEVEL SECURITY; |
There was a problem hiding this comment.
SUGGESTION: RLS is enabled but no policy exists, unlike the repo's other server-only tables
oauth_tokens and oauth_states follow the established pattern of an explicit service-role policy (20260324130000_fix_function_search_path_and_oauth_rls.sql:195-197 and 211-213), which documents the intent and keeps the Supabase advisor from flagging "RLS enabled, no policy" on every dashboard load.
Add the same policy here:
CREATE POLICY "Service role has full access to webhook endpoint secrets"
ON public.webhook_endpoint_secrets FOR ALL TO service_role
USING (auth.role() = 'service_role');| }); | ||
|
|
||
| it("captures child tables only for an entity that builds them into its payload", () => { | ||
| for (const row of sources.filter((source) => !source.isRoot)) { |
There was a problem hiding this comment.
WARNING: The parity check only runs SQL -> TS, so a TS child with no capture source is invisible
This loop walks the private.webhook_entity_sources rows and asserts each one is a payload child. It never walks DATA_SHARING_ENTITIES[].children, so a child registered in TS but missing from SQL passes - which is exactly the sets / rep_summaries gap in the migration, and the header comment at lines 10-12 promises both directions are checked.
Add the reverse direction: for every entity.children entry assert a source row exists with the same id_column and a parent_table equal to child.parent. Note line 165 currently asserts child.parent === entity.table, which contradicts the DataSharingChild.parent doc at dataSharingScopes.ts:101-105 ("the entity's own table or another child") and would fail as soon as a nested child is added.
| known.add(child.table); | ||
| } | ||
| } | ||
| for (const [table, columns] of Object.entries( |
There was a problem hiding this comment.
WARNING: The omission list is only checked for existence, never enforced
This asserts that each column named in DATA_SHARING_OMITTED_COLUMNS exists in the manifest. It never asserts the opposite, so emptying the map keeps the suite green and profiles.stripe_customer_id would then be copied into every profile webhook payload. The manifest's own credential rule (/token|api_key|secret|password/, tests/security/user-data-manifest.test.ts:72) does not match that column name, so nothing else would catch it either.
Assert that for every shared table, manifest.columns minus DATA_SHARING_OMITTED_COLUMNS[table] contains no credential-like column, and that profiles.stripe_customer_id is in the omission map.
| [...DATA_SHARING_SCOPES].sort(), | ||
| ); | ||
| expect(quotedList(migration, "CHECK (entity IN (", ")").sort()).toEqual( | ||
| [...DATA_SHARING_ENTITIES.map((entry) => entry.entity), "ping"].sort(), |
There was a problem hiding this comment.
SUGGESTION: ping is hardcoded here and has no entry in the registry
webhook_deliveries_entity_check allows 13 entity names; the 13th (ping) exists only in this expectation. getDataSharingEntity('ping') returns undefined, so the payload builder cannot resolve the test-delivery event the migration depends on (lines 796-798: the owner "has to pass a test delivery to switch it back on").
Model ping in the registry as a delivery-test event with no table, or derive the expected list from the registry instead of hardcoding the extra name.
| }; | ||
| set_webhook_endpoint_header: { | ||
| Args: { | ||
| p_custom_header_name: string; |
There was a problem hiding this comment.
SUGGESTION: The generated Args do not reflect that these two parameters are nullable
set_webhook_endpoint_header accepts two NULLs to clear the header ("Sets or clears (both NULL)", migration lines 545-547), but neither parameter has a DEFAULT, so the generator emits them as required non-null strings. create_webhook_endpoint declares DEFAULT NULL for the same pair (migration lines 429-430) and is generated as optional.
Declare DEFAULT NULL on both parameters and regenerate the types so the two RPCs have the same shape.
Code Review SummaryStatus: 8 Issues Found | Recommendation: Address before merge VerdictComment only — the incremental change is sound; every remaining finding is hardening, test strength or documentation, not a live defect. Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (9 files)
Ponytail Reviewsupabase/.branches/_current_branch:L1: delete: committed Supabase CLI local state. Delete the file and ignore supabase/functions/_shared/dataSharingScopes.ts:L115: shrink: supabase/migrations/20261106120000_webhook_data_sharing.sql:L1035: reuse: the function-privilege self-check re-implements tests/security/data-sharing-scopes.test.ts:L197: test-shrink: the omit-list test asserts the constant against a literal copy of itself, so it can only fail if both are edited. Replace it with one rule over the effective payload columns (manifest columns minus the omission list contain no billing or credential name). Ponytail net: -40 lines. Suggested Minimal Patch
No new dependencies. Final Merge GuidanceAlready merged. The two WARNING items should land as a follow-up: the missing Fix these issues in Kilo Cloud Previous Review Summary (commit 2dc2b4b)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 2dc2b4b)Status: 10 Issues Found | Recommendation: Address before merge VerdictRequest changes — one CI-blocking pgTAP floor mismatch and a capture gap between the TypeScript registry and the SQL triggers. Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (8 files)
Ponytail Reviewsupabase/migrations/20261106120000_webhook_data_sharing.sql:L387: shrink: the six supabase/migrations/20261106120000_webhook_data_sharing.sql:L985: reuse: the definer-privilege self-check re-implements supabase/functions/_shared/dataSharingScopes.ts:L41: yagni: supabase/functions/_shared/dataSharingScopes.ts:L313: yagni: Ponytail net: -45 lines. Suggested Minimal Patch
No new dependencies. Final Merge GuidanceCan merge after the CRITICAL finding is fixed: the pgTAP floor must match the suite's real count or the Migrations workflow fails. The Reviewed by minimax-m3 · Input: 123.2K · Output: 53.7K · Cached: 2.4M Review guidance: REVIEW.md from base branch |
- The registry and the capture triggers could drift: a trigger's arguments are frozen when it is created. Trigger creation is now private.sync_webhook_capture_triggers(), which a later migration calls after editing private.webhook_entity_sources and which also removes capture triggers from tables that are no longer a source. pgTAP fails when a trigger's arguments differ from its row (verified by editing a row without rebuilding). The header no longer claims they cannot drift. - The "does any active endpoint share this scope" probe ran on every write to a shared table with no index to use. Added a partial GIN index on scopes and switched the probe to @> so it can use it. - sets and rep_summaries are payload children with no capture trigger. That is sound today (no browser role can write them, and every server writer rewrites exercises in the same call) but was neither stated nor tested. It is now documented, marked capturedThrough in dataSharingScopes.ts, checked in both directions by the parity test, and guarded by a pgTAP assertion on the grants. - The profile omit list (stripe_customer_id and two internal columns) is now asserted, not only checked for existence. - set_webhook_endpoint_header's two header arguments DEFAULT NULL, matching how they are used and the generated types. Not changed: the pgTAP floor finding (the suite count is what the CI job measured), and the endpoint-limit finding (endpoints are deleted through the webhook-endpoints function in the next PR). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Response to the automated review, after checking each finding against the code. Fixes are in Fixed
Addressed differently
Not changed
🤖 Generated with Claude Code |
| -- scope. The backfill reads it directly. The capture triggers are | ||
| -- built FROM it by private.sync_webhook_capture_triggers(), and a | ||
| -- trigger's arguments are frozen when it is created: a later migration | ||
| -- that edits a row MUST call that function again, or the triggers keep |
There was a problem hiding this comment.
WARNING: A later migration that calls sync_webhook_capture_triggers() gets no lock guidance
This header now tells future migrations to call that function after editing private.webhook_entity_sources, but the operator note below (lines 54-59) only covers applying this file, and only because this file sets SET LOCAL lock_timeout = '5s' (line 69). The function drops and recreates 45 triggers, and DROP TRIGGER / CREATE TRIGGER take ACCESS EXCLUSIVE locks on all 15 source tables (workout_sessions, exercises, personal_records, ...) that are held until the calling migration commits. A later migration that calls it without its own SET LOCAL lock_timeout can block every write to those tables for as long as it waits.
Required fix: extend the operator note to state that any migration calling private.sync_webhook_capture_triggers() must set its own SET LOCAL lock_timeout inside its BEGIN; / COMMIT; and be applied at low traffic, exactly as this file does.
| -- replace_session_children rewrites the children without touching the | ||
| -- parent row, so the session trigger alone would miss it. | ||
| -- `sets` and `rep_summaries` travel in the workout payload but are not | ||
| -- sources: no browser role can write them, and every server writer |
There was a problem hiding this comment.
WARNING: The sets / rep_summaries capture path rests on an invariant no test executes
The comment (and the new capturedThrough marker in dataSharingScopes.ts) now rests on two facts: no browser role can write those tables, and every server writer rewrites exercises in the same call. The new pgTAP assertion (webhook_data_sharing.test.sql:137-145) proves only the first; the second is unverified. The only capture test for this path calls replace_session_children with '[]'::jsonb for sets and rep_summaries (webhook_data_sharing.test.sql:331), so no set row is ever written by any test in the suite.
The premise does hold today: the only live writer is public.replace_session_children, which deletes and re-inserts exercises in the same transaction (20261002100000_paired_rep_power_contract.sql:219-227), so the exercises trigger fires. But that is a property of the call site, not of the RPC: p_exercises and p_sets are guarded independently (20261002100000_paired_rep_power_contract.sql:226 and :254), and service_role may write sets directly through PostgREST. A future writer that touches sets without rewriting exercises loses those events silently: no error, no delivery.
Required fix: add one pgTAP case that calls public.replace_session_children with a non-empty p_sets and p_rep_summaries and asserts that a single workout delivery is enqueued, so the claim is executed rather than asserted.
| WHERE n.nspname = 'public' | ||
| AND NOT t.tgisinternal | ||
| AND t.tgname IN ('webhook_capture_insert', 'webhook_capture_update', 'webhook_capture_delete') | ||
| AND c.relname NOT IN (SELECT source_table FROM private.webhook_entity_sources) |
There was a problem hiding this comment.
SUGGESTION: The stale-trigger cleanup silently drops every capture trigger if the caller cannot see the source rows
The function is SECURITY INVOKER and private.webhook_entity_sources has RLS enabled with no policy (lines 272-274). For any caller that can read the table but sees zero rows through RLS, c.relname NOT IN (<empty set>) is true for every public table, so this loop drops all 45 capture triggers; the create loop below then rebuilds none, and webhook capture dies silently with no error.
Not reachable today - EXECUTE is revoked from PUBLIC, anon, authenticated and service_role (lines 458-459) and the owner bypasses RLS - but the function is now documented as a reusable entry point for future migrations, where that failure mode is total and silent.
Required fix: guard the function before the cleanup loop, for example IF NOT EXISTS (SELECT 1 FROM private.webhook_entity_sources) THEN RAISE EXCEPTION 'webhook capture: entity sources not visible to this role'; END IF;.
| 'complete_webhook_delivery', 'enqueue_webhook_backfill')) | ||
| OR (n.nspname = 'private' | ||
| AND p.proname IN ('enqueue_webhook_deliveries', 'prune_webhook_deliveries', | ||
| 'schedule_webhook_jobs', 'sync_webhook_capture_triggers')) |
There was a problem hiding this comment.
SUGGESTION: The pgTAP twin of this privilege list was not updated
This list now includes sync_webhook_capture_triggers, but the identical enumeration in the test file (supabase/tests/database/webhook_data_sharing.test.sql:72-74) still lists only the three older private functions, so the assertion no browser role can execute any webhook function no longer covers the new one. The migration's own self-check still catches a grant at apply time, so this is only the second line of defence.
Required fix: add sync_webhook_capture_triggers to the IN (...) list at webhook_data_sharing.test.sql:73-74.
| 'no browser role can write sets or rep_summaries, which workout capture relies on' | ||
| ); | ||
|
|
||
| SELECT has_index('public', 'webhook_endpoints', 'webhook_endpoints_active_scopes_idx', |
There was a problem hiding this comment.
SUGGESTION: has_index does not prove the index is partial or GIN
The four-argument has_index(schema, table, index, description) only checks that an index with that name exists on that table; it never looks at pg_am or pg_index.indpred. This assertion would still pass if the index were recreated as USING btree (scopes) with no WHERE clause - and the probe at 20261106120000_webhook_data_sharing.sql:343 (e.scopes @> ARRAY[c_scope]) needs GIN to use it, so the regression would be a silent sequential scan on every write to every shared table.
Required fix: follow the repo's own idiom in supabase/tests/database/sync_queue_dedupe.test.sql:25-45 - keep has_index and add an assertion on pg_index.indpred IS NOT NULL plus pg_am.amname = 'gin' (or on pg_get_indexdef).
| ).toBeDefined(); | ||
| // The capture records the parent id found in this column. | ||
| expect(child?.fkColumn).toBe(row.idColumn); | ||
| expect(child?.parent).toBe(entity?.table); |
There was a problem hiding this comment.
SUGGESTION: This assertion forbids the nested children this PR just added
DataSharingChild.parent is documented as the entity's own table or another child (dataSharingScopes.ts:101-105), and the registry now uses that: sets.parent is exercises and rep_summaries.parent is sets. This assertion compares only against entity?.table, so it rejects any nested child. It does not fail today because the loop iterates the SQL source rows and sets / rep_summaries are not sources - but the natural fix for the capture gap (adding sets to private.webhook_entity_sources) would make this test fail against a correct registry, and with no message argument it would not say which row caused it.
Required fix: use the ancestor rule this file already implements at lines 281-292 - build known = new Set([entity.table]) per entity and assert known.has(child.parent) as each child is added. The same pass can replace the new capturedThrough field, which encodes the same information less strictly: it names a sibling, but exercises is rep_summaries' grandparent.
| @@ -0,0 +1 @@ | |||
| main No newline at end of file | |||
There was a problem hiding this comment.
SUGGESTION: Committed Supabase CLI local state
supabase/.branches/_current_branch is local state written by the Supabase CLI: it records the developer's currently selected preview branch. It is the only tracked dot-path under supabase/ (the repo ignores supabase/.temp/ but not supabase/.branches/), nothing in the repo, the scripts or CI reads it, and the committed value (main) is meaningless to anyone else.
Required fix: delete the file and add supabase/.branches/ to .gitignore, next to the existing supabase/.temp/ rule.
`supabase/.branches/_current_branch` is written by `supabase start` and was committed by accident in #546. Untrack it and ignore the directory. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
What
Database half of user-configurable data sharing: a FLAME+ user registers HTTPS endpoints they control, and the portal pushes their own data there as signed JSON events. This is PR 1 of 4 (schema →
webhook-endpointsEdge Function →deliver-webhooksworker → portal UI).Inert on its own. With no row in
webhook_endpointsevery capture trigger returns after one probe, and thedeliver-webhookscron job is created inactive.Changes
webhook_endpoints: endpoint metadata. OwnerSELECTonly; every write goes through the service role.webhook_endpoint_secrets: service-only ciphertext (signing secret, optional custom header value). Same split asuser_integrations/oauth_tokens.webhook_deliveries: outbox and delivery log. Rows are thin references (endpoint, entity, id); payloads are built at send time, so no user data is copied.AFTER INSERT/UPDATE/DELETEtriggers on each shared table, generated fromprivate.webhook_entity_sources. One mechanism covers bothSYNC_LWW_ENABLEDpaths, the push transaction, portal PostgREST writes and RPCs.exercisesis captured becausereplace_session_childrennever touchesworkout_sessions.create_webhook_endpoint(max 3 per user),rotate_webhook_signing_secret,set_webhook_endpoint_header,claim_webhook_deliveries(FOR UPDATE SKIP LOCKED),complete_webhook_delivery(backoff over 9 attempts, about 46 h),enqueue_webhook_backfill._shared/dataSharingScopes.ts: nine scopes, twelve entities, and aNOT_SHAREABLElist with a reason per table.userDataManifest.ts(secrets tableEXCLUDED),rls_isolation.test.sql, generated types;PGTAP_TEST_FLOORraised to 2250.Not shared, by design
Raw telemetry; the INFERNO-gated biomechanics tables (
session_phase_statistics,vbt_assessments,exercise_signatures); Strava-sourcedexternal_activitiesrows (Strava's API terms restrict onward disclosure; not checked against the live agreement, so excluded by default); community rows; billing and sync bookkeeping.Axioms (
docs/axioms.md)user_id. Composite FK(endpoint_id, user_id) → webhook_endpoints (id, user_id)makes a cross-user delivery unrepresentable. Backfill filters the source table by the endpoint owner.user_idon A's endpoint raises 23503; backfill with another user's id returns 0.subscription_tier_for, so the past-due and 48 h grace rules apply), closes its waiting rows, and the trigger then stops enqueuing. INFERNO-gated tables are never shared.paused/subscription_lapsed, next write enqueues nothing.auth.users; manifest andEXCLUDEDupdated.gen:types:check, clean apply.disabled/too_many_failuresandendpoint_goneassertions.Verification
npm run test:db: 44 files, 2250 assertions, pass (87 in the newwebhook_data_sharing.test.sql).npm test: 2496 passed.npm run typecheck: no new errors.npm run gen:types:check: in sync.npm run lint: exit 0.db reset --no-seed, then applied a second time with no error.exercisescapture triggers disabled the children-rewrite assertion fails; with the trigger's exception handler removed the FP-3 assertions fail.npm run test:edge: 1097 passed, 2 failed, both in_shared/paddleFetch.test.tson a/D:/…path it builds on Windows. That file is not touched here; I did not run it on Linux.CI
Dependency Audit is red and is a required check. It fails on
glob/minimatchadvisories in build-time dependencies, published aftermainlast ran CI. This PR changes no dependency. #550 fixes it with two scoped overrides and is green. Merge #550 first, then update this branch frommainso the check re-runs against the fix.Stacked work. #547 (
webhook-endpoints), #548 (deliver-webhooks) and #549 (portal UI) are open and stacked on this PR in that order.ci.ymldoes not run on a PR whose base is notmain, so they get their full checks once retargeted. If this PR is squash-merged, each needsgit rebase --onto origin/main <previous branch> <branch>before retargeting.Operator
BEGIN … ROLLBACKagainst prod, thensupabase db push. The file creates three triggers on each of the busiest tables and each needs a brief lock, so run it at low traffic. Alock_timeoutfailure is a clean retry: the file is one transaction.deliver-webhookscron job inactive until PR 3 is deployed. Activating it later is the on switch; deactivating it is the kill switch.🤖 Generated with Claude Code