Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching for square bracket in timeline freezes the app #1541

Open
saminadhikari18 opened this issue Feb 13, 2025 · 1 comment
Open

Searching for square bracket in timeline freezes the app #1541

saminadhikari18 opened this issue Feb 13, 2025 · 1 comment
Labels
bug 🪲 Nope, this is wrong. good first issue 🎉 Something easier for newcomers!

Comments

@saminadhikari18
Copy link

saminadhikari18 commented Feb 13, 2025

App freeze while searching timeline

When I search for opening square bracket [ either at the start on somewhere in between, the app just goes blank.

Platform: Mac OS 15.3.1

Kapture.2025-02-13.at.13.18.16.mp4

Reactotron version

3.7.4

@silasjmatson silasjmatson added the bug 🪲 Nope, this is wrong. label Feb 26, 2025
@silasjmatson
Copy link
Contributor

silasjmatson commented Feb 26, 2025

Thanks for the bug report!

Duplicated on latest release (v3.7.6)

Screen.Recording.2025-02-26.at.10.21.50.AM.mp4

Failure happens here:

const searchRegex = new RegExp(trimmedSearch.replace(/\s/, "."), "i")

Constructing a regular expression with new RegExp('[', 'i') is invalid and will throw an error.

This is a result of the simple but naive approach of constructing a regex based on user input. We have a few options to fix:

  1. Escape regex special chars
  2. Just use something like microfuzz to do searching for us

@silasjmatson silasjmatson added the good first issue 🎉 Something easier for newcomers! label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Nope, this is wrong. good first issue 🎉 Something easier for newcomers!
Projects
None yet
Development

No branches or pull requests

2 participants