Skip to content

fix(explore): Remove empty field params from Explore URL#110655

Open
nsdeschenes wants to merge 3 commits intomasterfrom
nd/EXP-838/fix-explore-validate-and-remove-empty-fields
Open

fix(explore): Remove empty field params from Explore URL#110655
nsdeschenes wants to merge 3 commits intomasterfrom
nd/EXP-838/fix-explore-validate-and-remove-empty-fields

Conversation

@nsdeschenes
Copy link
Contributor

Empty field= parameters in the Explore page URL (e.g. &field=timestamp&field=&field=parent_span) cause validation errors when saving a query, because the empty string is treated as a required-but-blank field name.

This adds defense-in-depth filtering at both the read and write boundaries:

  • Read: getFieldsFromLocation now filters out empty strings after decodeList(), so any stale field= in the URL is stripped before the app sees it.
  • Write: Both spans and logs getTargetWithReadableQueryParams filter empty strings before writing fields back to the URL.

Fixes EXP-838

Filter out empty strings from decoded field arrays in
getFieldsFromLocation so stale `field=` query params don't cause
validation errors when saving queries.
Defense-in-depth: strip empty strings from fields before writing to the
URL in both spans and logs query param helpers.
@linear-code
Copy link

linear-code bot commented Mar 13, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 13, 2026
@nsdeschenes nsdeschenes changed the title fix(explore): strip empty field params from Explore URL fix(explore): Remove empty field params from Explore URL Mar 13, 2026
@nsdeschenes
Copy link
Contributor Author

@sentry review

@nsdeschenes
Copy link
Contributor Author

@cursor review

Add explicit null check before optional chaining so that
updateNullableLocation still receives null (meaning "delete the key")
rather than undefined (meaning "do nothing") when fields is null.
@nsdeschenes
Copy link
Contributor Author

@sentry review

@nsdeschenes
Copy link
Contributor Author

@cursor review

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@nsdeschenes nsdeschenes marked this pull request as ready for review March 13, 2026 17:31
@nsdeschenes nsdeschenes requested a review from a team as a code owner March 13, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant