feat(QueryEditor): validate ad-hoc filters against via known field names from field_names request#635
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
4 issues found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/components/QueryEditor/useAdHocFilterValidation.ts">
<violation number="1" location="src/components/QueryEditor/useAdHocFilterValidation.ts:69">
P2: Clear `known` on cache miss before fetching; otherwise validation can use stale field-name data from a previous query context.</violation>
<violation number="2" location="src/components/QueryEditor/useAdHocFilterValidation.ts:91">
P1: Async field-list responses are not guarded against out-of-order completion, so stale requests can overwrite validation state for newer filters/time ranges.</violation>
</file>
<file name="src/datasource.ts">
<violation number="1" location="src/datasource.ts:209">
P2: `queryHasFilter` compares unescaped values against escaped stored filters, so active filters with special characters are not recognized.</violation>
<violation number="2" location="src/datasource.ts:232">
P1: Removing the `extraFilters` fallback breaks backward compatibility for existing queries that still store ad-hoc filters only in `extraFilters`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
9cc757f to
5cc04bc
Compare
dmitryk-dk
approved these changes
May 11, 2026
Contributor
dmitryk-dk
left a comment
There was a problem hiding this comment.
Just check one comment where the dependecy missing
5cc04bc to
cd197fc
Compare
…mes from `field_names` request
cd197fc to
767a51b
Compare
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.
Related issue: #626
Follow-up: 7cac781
Describe Your Changes
Added highlighting of field names that were added via some transformation functions, such as

unpack_json,unpack_logfmt, and so on.Checklist
The following checks are mandatory:
Summary by cubic
Validate ad‑hoc filters in Explore by checking filter keys against known field names from
field_names. Mark filters that target computed fields and let users move them into the query to avoid empty or incorrect results.New Features
field_names, scoped by bucketed time range (day/week/month/year) andstreamFilters; results cached with LRU. On request errors or unresolved variables, filters default to valid.Refactors
query.adHocFilters; they serialize toextraFiltersonly at request time. Backend API unchanged.toggleQueryFilterto add/remove structured filters; addedqueryHasFilterso Logs viewer “Filter for/out” actions keep working.serializeAdHocFilters,formatAdHocFilterLabel, andbucketTimeRange;language_providernow always setslimit.Written for commit cd197fc. Summary will update on new commits.