Skip to content

ATLAS-5333: Atlas React UI: Clearing a Classification search filter triggers 400 Bad Request on empty parameters#692

Merged
pawarprasad123 merged 1 commit into
apache:masterfrom
Brijesh619:ATLAS-5333
Jul 8, 2026
Merged

ATLAS-5333: Atlas React UI: Clearing a Classification search filter triggers 400 Bad Request on empty parameters#692
pawarprasad123 merged 1 commit into
apache:masterfrom
Brijesh619:ATLAS-5333

Conversation

@Brijesh619

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR fixes an issue where clearing a Classification search filter triggered a 400 Bad Request error.

Root Cause:
When navigating to classification searches from the Dashboard (e.g., Overview Card, Classification Types in Use), dashboardSearchUtils.ts was explicitly appending an empty type="" parameter to the search URL. When a user subsequently cleared the classification filter via the "X" button, FilterQuery.tsx incorrectly detected the dangling type= parameter as a "meaningful" filter. This caused the UI to fire an empty search request to the backend instead of safely resetting the search state.

Fix:
Removed the explicit injection of params.set("type", ""); in src/utils/dashboardSearchUtils.ts when building classification URLs. By preventing the empty type parameter from being added, FilterQuery now correctly identifies when zero meaningful filters remain, safely navigating the user back to the default /search page without throwing a 400 error.

How was this patch tested?

Manual testing performed:

  1. Navigated to the Dashboard / Overview page.
  2. Clicked on the Classifications count link inside the Overview card.
  3. On the resulting Search Results page, clicked the "X" to clear the Classification filter.
  4. Verified that the UI safely routed back to the default /search page without throwing a 400 Bad Request backend error.
  5. Repeated the above steps for the "Classification Types In Use" links to ensure coverage.
  6. Verified that npm run build completes successfully with no regressions.

@pawarprasad123 pawarprasad123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

changes LGTM

@pawarprasad123 pawarprasad123 merged commit 7a528de into apache:master Jul 8, 2026
2 checks passed
pawarprasad123 pushed a commit that referenced this pull request Jul 8, 2026
…riggers 400 Bad Request on empty parameters (#692)

( cherry-picked from commit 7a528de)
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.

2 participants