Skip to content

Conversation

@lukemelia
Copy link
Contributor

@lukemelia lukemelia commented Jan 30, 2026

Summary

  • normalizeQueryDefinition now recursively walks the filter tree to inject on into leaf attribute filters (eq, contains, range) that lack one
  • Combinator filters (not, any, every) are traversed without injection at their level
  • type filters (self-scoping) are skipped
  • Existing on references on leaf filters are preserved

Fixes CS-10126

🤖 Generated with Claude Code

…ryDefinition

Previously, `normalizeQueryDefinition` only injected the `on` reference
at the top-level filter. Combinator filters (not, any, every) left their
inner leaf attribute filters without `on`, producing invalid filter
structures. This adds a recursive walk that injects `on` into each leaf
filter (eq, contains, range) that lacks one, while skipping type filters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

Preview deployments

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

Host Test Results

    1 files  ±    0      1 suites  ±0   2h 40m 4s ⏱️ + 56m 34s
1 932 tests +    7  1 914 ✅ +    6  17 💤 ± 0  1 ❌ +1 
3 072 runs  +1 132  3 042 ✅ +1 119  29 💤 +12  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 4452a15. ± Comparison against base commit bc47720.

♻️ This comment has been updated with latest results.

@lukemelia lukemelia requested a review from Copilot February 2, 2026 19:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances normalizeQueryDefinition to recursively inject the on property into leaf attribute filters within combinator filters (not, any, every), ensuring all leaf filters have the proper scope reference.

Changes:

  • Replaced simple on injection with recursive traversal of filter trees
  • Added injectOnIntoLeafFilters function to handle nested combinator filters
  • Added comprehensive test coverage for nested filter scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/runtime-common/query-field-utils.ts Implements recursive filter tree traversal logic to inject on into leaf filters while preserving combinator structure
packages/host/tests/unit/query-field-normalization-test.ts Adds test cases for not, any, every combinators, deeply nested filters, type filter handling, and existing on preservation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lukemelia lukemelia merged commit 27958d2 into main Feb 2, 2026
177 of 186 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants