fix(db): guard ::uuid cast in provisioning trigger against malformed company_id (#62) - #70
Merged
Merged
Conversation
…company_id (#62) The WHEN clause of trg_provision_workspace_membership now regex-validates the canonical UUID shape before the function's unconditional ::uuid cast runs, so a malformed company_id fails WHEN, the function never executes, and the auth.users write commits (provisioning silently skipped) instead of aborting on 22P02. Trigger-only fix-forward — function body unchanged, WHEN references only NEW (no 42P17). Already applied to prod zgkvbjqlvebttbnkklpo via apply_migration. Flattened onto main (was a merge commit) to resolve the STATUS.md / cross-repo-log.md overlap with #61 (#68) — both follow-ups now land in the same backlog line and Done section. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Replaces #66, whose GitHub head object got stuck on a pre-merge commit (the
synchronizewebhook never fired after the conflict resolution was pushed, so its merge engine kept seeing a stale conflicting tree). Identical content, on a fresh branch flattened linearly ontomain.Adds a UUID-format regex to
trg_provision_workspace_membership'sWHENclause so a malformedcompany_idfailsWHEN(the function never runs, theauth.userswrite commits) instead of aborting the invite on22P02. Trigger-only fix-forward, function body unchanged (noCREATE OR REPLACE),WHENreferences onlyNEW(no42P17). Already applied to prodzgkvbjqlvebttbnkklpoviaapply_migrationand verified in a rolled-back transaction.Fixes #62.
🤖 Generated with Claude Code