Fix #2462: allow MATCH Input when Output has no MATCH#3756
Merged
Conversation
Allow Input/State MATCH wildcards that aren't covered by the Output's MATCH keys when the callback has a fixed-id Output, no Output, or only ALL-wildcard Outputs. ALLSMALLER still requires a MATCH reference. Fixes #2462. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When a callback's Outputs have no MATCH keys, multiple simultaneous MATCH-triggered firings would collapse to the same resolvedId and dedupe into a single invocation, losing all but the first trigger's resolver. Thread the triggering Input's MATCH values through as the callback's anyVals so each MATCH firing is addressable separately. Refs #2462. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- findMismatchedWildcards permits MATCH in Input/State when the Output is a fixed-id, no-output, or ALL-only wildcard. - ALLSMALLER and cross-Output MATCH mismatches still error. - getAnyVals returns the trigger's MATCH values. - getCallbacksByInput yields distinct resolvedIds per MATCH trigger when the Output has no MATCH keys. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds three integration tests covering the relaxed semantics from #2462: - MATCH Input + fixed-id Output + State MATCH returns the right id. - MATCH Input + no Output uses set_props against a fixed-id target. - Repeated MATCH clicks resolve State to the current trigger, not a stale first one (verifies per-trigger resolvedId uniqueness). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds test_dvcv017 to confirm that callbacks with fixed-id, no-output, or ALL-only wildcard outputs accept MATCH inputs without dispatching validation errors, and test_dvcv018 to confirm ALLSMALLER still needs a matching MATCH in the Output(s). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the extra MATCH-repeated-clicks integration test and the ALLSMALLER-still-errors devtools test; keep only the two new-case tests (MATCH → fixed Output, MATCH → no Output) plus the validation smoke test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Black: collapse two click() chains that fit on one line and drop a trailing blank line. Prettier: reformat the new Mocha test file to match renderer style. Flake8 W391 clears once the trailing blank lines go. Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Fixes #2462.
Two years of comments on that issue all land in the same place: people want to use
MATCHin anInput/Statewithout repeating the sameMATCHkeys on theOutput. This PR does exactly that.Behavior change
You can now pair a
MATCHinput with a fixed-id Output, no Output, or a wildcard Output that only usesALL:Rules kept intact:
MATCHkeys.ALLSMALLERstill requires a correspondingMATCHin an Output — it has no reference otherwise.What's in the diff
dependencies.js::findMismatchedWildcards) — skip the Input/StateMATCH-subset check when the Output has noMATCHkeys.dependencies.js::addAllResolvedFromOutputs+dependencies_ts.ts::getCallbacksByInput) — when the Output lacksMATCH, the triggering Input'sMATCHvalues become the callback'sanyValsso simultaneous MATCH triggers each get a distinctresolvedIdand don't collapse into one firing during deduplication.Tests run locally
tests/unit/— 377 passed, 4 skipped (2 browser-smoke failures are chromedriver/env, unrelated)tests/compliance/— 13 passeddash-rendererKarma — 25 passed (includes 9 new cases for validation +resolvedIduniquification)test_cbwc009_match_input_fixed_output,test_cbwc010_match_input_no_output,test_dvcv017_match_input_permitted_no_output_match— passedtest_cbwc002_fibonacci_app,test_cbwc003_same_keys,test_cbwc008_running_match,test_dvcv006_inconsistent_wildcards— all still passTest plan