Treat an unrecognized ticket-callout builtin_key as custom#2014
Closed
maebeale wants to merge 2 commits into
Closed
Treat an unrecognized ticket-callout builtin_key as custom#2014maebeale wants to merge 2 commits into
maebeale wants to merge 2 commits into
Conversation
A keyless (custom) callout must store NULL, not "". The inclusion validation allows nil but not blank, and the custom/builtin scopes plus the [event_id, builtin_key] unique index all key off NULL — so a stray blank string fails validation and wedges the whole event save. Coerce blank to nil before validation so all four agree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
An event couldn't be saved once one of its callouts carried a builtin_key no longer in BUILTIN_KEYS (a since-removed built-in like "event_details"): editing the event re-validated that row and the inclusion check 422'd the whole save, with no way to fix it from the editor. Normalize any key that isn't a current built-in (blank or removed) to nil, so the row becomes a plain custom callout — editable, deletable, and valid — and heals to nil on the next save. A removed built-in has no card builder anyway, so it could never render as a real built-in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maebeale
marked this pull request as ready for review
July 24, 2026 19:59
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.
🤖 suggested review level: 3 Read 📖 model normalization + specs; changes validation behavior for unknown keys
What is the goal of this PR and why is this important?
Editing an event 422'd with "Registration ticket callouts builtin key is not included in the list" whenever one of its callouts carried a
builtin_keyno longer inBUILTIN_KEYS— a since-removed built-in (prod has 3event_detailsrows). Autosave re-validates that row on edit and the inclusion check blocks the whole save, with no way to fix it from the editor (the row renders as a built-in with no delete/reset).How did you approach the change?
normalizes :builtin_keynow drops any key that isn't a current built-in (blank or removed) tonil, so the row becomes a plain custom callout — editable, deletable, valid — and heals tonilon the next save. A removed built-in has no card builder anyway, so it could never render as a real built-in. Test-first: model spec (blank + removed key → custom) and a request regression (editing a legacy-key event now saves and converts the row).Anything else to add?
Rows on events that are never edited stay as-is until touched (harmless/inert); an optional one-off
UPDATE registration_ticket_callouts SET builtin_key = NULL WHERE builtin_key NOT IN (...)heals them all at once.