fix(lint): flag every never-firing record--prefixed trigger token, incl. record-change (#3427)#3469
Draft
os-zhuang wants to merge 1 commit into
Draft
fix(lint): flag every never-firing record--prefixed trigger token, incl. record-change (#3427)#3469os-zhuang wants to merge 1 commit into
record--prefixed trigger token, incl. record-change (#3427)#3469os-zhuang wants to merge 1 commit into
Conversation
…`record-change` (#3427) Generalizes the `flow-trigger-unknown-event` rule to flag any `record-`-prefixed `triggerType` that isn't a valid firing token (`record-{before,after}-{create,insert,update,delete,write}`), not just `record-(before|after)-<bad-op>` typos. This closes the `record-change` trap (the engine routes it to the record-change trigger, which maps it to no hook so it never fires) at `os validate` time, and also covers bad-phase tokens like `record-during-update`. Warning severity, unchanged. Companion objectui change removes `record-change` from the Studio flow picker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018939yJ413zG3irLzcTtqaa
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
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.
Summary
Closes the
record-change"declared ≠ enforced" trap found while building therecord-after-writelint (#3467).The engine routes any
record--prefixedtriggerTypeto the record-change trigger (triggerType.startsWith('record-')), which then maps it to ObjectQL hooks viatriggerTypeToHookEvents. Tokens that don't match the firing grammarrecord-{before,after}-{create,insert,update,delete,write}— a typo likerecord-after-updated, a phase-less bare noun likerecord-change(which the Studio picker offered as "Record changed (any)"), or a bad phase likerecord-during-update— bind to the trigger but map to no hook, so the flow never fires, with only a runtime warn.This generalizes the
flow-trigger-unknown-eventrule (shipped in #3467) to flag all such never-firingrecord--prefixed tokens atos validatetime, not just therecord-(before|after)-<bad-op>subset. Warning severity, unchanged.Why trim
record-change, not implement itrecord-changereads as "fire on any change (create/update/delete)". I deliberately did not implement it: doing so would silently activate any previously-deadrecord-changeflow in existing apps on upgrade — a surprising behavior change. Trimming closes the trap with no runtime behavior change and keeps the trigger grammar clean (record-<phase>-<op>+ thewriteunion). The companion objectui PR removesrecord-changefrom the Studio flow picker so it can't be authored there; this lint catches any hand-written one. (Broader multi-event unions remain tracked by #3457.)Tests
validate-flow-trigger-readinesssuite updated:record-changeandrecord-during-updatenow flagged; the canonical firing tokens (incl.record-after-write) still pass; non-recordtriggerTypes (schedule/api/manual) untouched. Full@objectstack/lintsuite green.Changeset
@objectstack/lint: patch.Related
#3427, #3446, #3467 (the
record-after-writefeature + the original lint rule), #3457 (deferred multi-event decision), and the companion objectui PR (Studio picker).Generated by Claude Code