Skip to content

fix(search): warn once with the final rewritten query - #1624

Draft
betegon wants to merge 1 commit into
fix/search-numeric-project-idfrom
fix/search-rewrite-warn-final
Draft

betegon wants to merge 1 commit into
fix/search-numeric-project-idfrom
fix/search-rewrite-warn-final

Conversation

@betegon

@betegon betegon commented Sep 22, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #1621. sanitizeQuery warned Running query: after the numeric project: rewrite, then again after OR/AND. Combined input logged an intermediate that never ran.

All rewrites now finish first. One warning, quoting the query that is actually sent. Same for a failed OR: no Running query: before the ValidationError.

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:

⚠ `project` is the slug; numeric ids use project_id. Rewrote numeric project: filters. Running query: "project_id:123 OR project_id:456"
⚠ Rewrote OR using in-list syntax: key:[val1,val2]. Running query: "project_id:[123,456]"

After — one warning, final query only:

⚠ `project` is the slug; numeric ids use project_id. Rewrote numeric project: filters. Rewrote OR using in-list syntax: key:[val1,val2]. Running query: "project_id:[123,456]"

Test plan

  • project:123 OR project:456project_id:[123,456], one Running query: line
  • project:123 AND is:unresolvedproject_id:123 is:unresolved, one warning
  • level:error OR assigned:me throws with no Running query:
  • From packages/cli: pnpm exec vitest run test/lib/search-query.test.ts test/lib/search-query.warn.test.ts

Made with Cursor

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>
@vercel
vercel Bot temporarily deployed to Preview – sentry-local September 22, 2026 14:28 Inactive
@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Sep 22, 2026 2:29pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Sep 22, 2026 2:29pm UTC

Request Review

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli d18e84a1 Deployed Sep 22, 2026 by vercel[bot]
Preview – sentry-local d18e84a1 Deployed Sep 22, 2026 by vercel[bot]
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.

1 participant