Skip to content

Update regular expression filters with proper error handling#133

Open
andrlime wants to merge 1 commit intodilanx:mainfrom
andrlime:regular-expression-bug-fix
Open

Update regular expression filters with proper error handling#133
andrlime wants to merge 1 commit intodilanx:mainfrom
andrlime:regular-expression-bug-fix

Conversation

@andrlime
Copy link
Copy Markdown

@andrlime andrlime commented May 15, 2025

Fixing Regular Expression Search Filters

Summary

This pull request addresses ticket #ODXEx8Y. The TLDR is that searching and including regular expression characters – e.g. [, (, { – but not closing the brackets, leads to a full page crash because Search.ts tries to instantiate an invalid regular expression.

A new function was added to wrap instantiation in a try catch, and invalid regular expressions now propagate an error message to the user-facing frontend.

A side effect is that some forEach calls were replaced with for (const ... of ...) in order to support short circuit value returning.

Testing

The fixes were tested locally. The crash has been fixed.

@andrlime andrlime requested a review from dilanx as a code owner May 15, 2025 19:22
@andrlime andrlime force-pushed the regular-expression-bug-fix branch from 2478921 to 7f8a689 Compare May 15, 2025 19:34
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.

1 participant