Skip to content

Conversation

@AmmarKazi
Copy link

Description

This PR fixes a crash in the application search bar (Issue #9392) where TypeError: I.trim is not a function would occur if a searchable field (like description) contained a non-string value (e.g., a number or object) from a malformed import or database state.

The Fix

I updated the isMatched function in use-filtered-requests.ts to implement a sanitization pipeline:

  1. Filter: Explicitly removes null or undefined values.
  2. Coercion: Maps all remaining fields to String() before passing them to the fuzzy matcher.

This ensures that trim() is never called on a non-string type, preventing the runtime crash.

Verification

Reproduction:
I reproduced the crash locally by importing a workspace with a numeric description field (12345 instead of "12345"). The app previously crashed upon typing in the search bar.

Validation:
With this fix applied, searching against the same malformed data works correctly. The numeric values are coerced to strings and matched without error.

Closes #9392

@CLAassistant
Copy link

CLAassistant commented Dec 9, 2025

CLA assistant check
All committers have signed the CLA.

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.

TypeError: I.trim is not a function - App crashes and won't open again

2 participants