fix(search): warn once with the final rewritten query - #1624
Merged
betegon merged 2 commits intoSep 22, 2026
Merged
Conversation
sanitizeQuery used to log Running query: after the numeric project rewrite, then again after OR/AND. Combined input like project:123 OR project:456 warned with an intermediate that never ran. Collect notes and emit a single warning after every rewrite succeeds. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Member
|
I'd still split this into two where the "rewrote the query" part appears as a separate line |
The rewrite reasons and the query that actually runs are different things to scan. Keep one warn() so consola still prints a single ⚠, but break Running query: onto the next line. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
Done — still one |
This branch was successfully deployed
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
Follow-up to #1621.
sanitizeQuerywarnedRunning query:after the numericproject:rewrite, then again after OR/AND. Combined input logged an intermediate that never ran.All rewrites now finish first. One warning: reasons on the first line,
Running query:on the second, quoting the query that is actually sent. Same for a failed OR: noRunning query:before theValidationError.Stacked on #1621 — merge that first.
Before / after
sentry issue list --json -q "project:123 OR project:456"Before — two warnings, first one is a lie:
After — one warning, final query on its own line:
Test plan
project:123 OR project:456→project_id:[123,456], one warn,Running query:on the second lineproject:123 AND is:unresolved→project_id:123 is:unresolved, same shapelevel:error OR assigned:methrows with noRunning query:packages/cli:pnpm exec vitest run test/lib/search-query.test.ts test/lib/search-query.warn.test.ts