fix(search): dedupe bare and explicit filter key twins - #121700
Draft
sentry-junior[bot] wants to merge 2 commits into
Draft
fix(search): dedupe bare and explicit filter key twins#121700sentry-junior[bot] wants to merge 2 commits into
sentry-junior[bot] wants to merge 2 commits into
Conversation
Collapse tags[key,type] suggestions when the bare key already exists so search dropdowns no longer show duplicate attributes like user.email. Co-Authored-By: Alexandra Cota <[email protected]>
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.
Problem
Explore search can show the same attribute twice (for example
user.email). That happens when both the bare key and the explicit form (tags[user.email,string]) are present. The UI prettifies both labels to the same name, but dedupe only compared raw keys.Fix
Prefer the bare/canonical key and drop its explicit
tags[key,type]twin when both exist.static/app/utils/tag.tsuseSortedFilterKeyItemshasvalues fromgetHasTaghasvalue suggestions invalueComboboxDistinct typed explicit keys still both show when no bare key exists (for example
tags[foo,string]andtags[foo,number]).Tests
getHasTagVerified with:
pnpm test-ci static/app/utils/tag.spec.ts static/app/components/searchQueryBuilder/index.spec.tsx -t "async filter keys|collapseDuplicate|getHasTag|isRedundant"Requested by Alexandra Cota.
--
View Junior Session [Sentry]