Skip to content

fix(search): fix exact match for theme presearch#7247

Open
rmelisson wants to merge 1 commit intodevfrom
fix/search-theme-exact
Open

fix(search): fix exact match for theme presearch#7247
rmelisson wants to merge 1 commit intodevfrom
fix/search-theme-exact

Conversation

@rmelisson
Copy link
Copy Markdown
Contributor

No description provided.

@revu-bot revu-bot Bot requested a review from revu-bot April 21, 2026 15:14
@rmelisson rmelisson temporarily deployed to build-preproduction April 21, 2026 15:14 — with GitHub Actions Inactive
Copy link
Copy Markdown
Collaborator

@revu-bot revu-bot left a comment

Choose a reason for hiding this comment

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

PR Summary: Fix exact match for theme presearch

This PR makes two changes:

  1. Removes an erroneous import of queryAllByAltText from @testing-library/react in a non-test file (good cleanup).
  2. Fixes the exact-match comparison for theme presearch by replacing == with JSON.stringify comparison on two arrays.

Critical Issue

The fix for array comparison is functionally correct (direct == on arrays always returns false unless same reference), but the chosen approach — JSON.stringify — is fragile and has known edge cases. A simpler, more idiomatic solution exists.

File Lines Severity Issue
presearch.ts 204–206 CRITICAL JSON.stringify for array equality is fragile; use a proper element-wise comparison

@sonarqubecloud
Copy link
Copy Markdown

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.

3 participants