mirror of
https://github.com/block/buzz.git
synced 2026-11-29 04:32:08 +00:00
fix(relay): revoke invitations durably and fence restricted claims
Keep v1 natural drain with an optional UTC cutoff. Serialize claim and mint policy reads with restriction and owner writes. Share historical revocation repair across migration and desired-state upgrades while retaining deletion fences. Co-authored-by: Codex <codex@openai.com> Signed-off-by: Brad Seiler <seiler@squareup.com> Signed-off-by: Local Builder <1c476cb1127ea270cb900bdc3891060140bdd1173f91498030ee9b4db01c2f20@buzz.block.builderlab.xyz>
This commit is contained in:
@@ -232,3 +232,19 @@ BEGIN
|
||||
RAISE EXCEPTION 'replica_heartbeat must contain its singleton row after pgschema apply';
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
-- Invitation revocation is historical DML; pgschema does not execute it.
|
||||
-- Use the same tenant-fenced, idempotent repair as migration0061.
|
||||
SELECT backfill_invite_revocations();
|
||||
DO $$
|
||||
BEGIN
|
||||
IF backfill_invite_revocations() <> 0 THEN
|
||||
RAISE EXCEPTION 'invitation revocation backfill did not converge';
|
||||
END IF;
|
||||
IF (SELECT count(*) FROM pg_trigger WHERE NOT tgisinternal
|
||||
AND tgname IN ('invite_restriction_lock', 'invite_issuer_revocation',
|
||||
'invite_owner_lock', 'invite_owner_revocation')) <> 4 THEN
|
||||
RAISE EXCEPTION 'invitation revocation triggers missing from live catalog';
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
|
||||
Reference in New Issue
Block a user