Desktop: Handles #7634: Handling errors when searched term is too long #7764
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #7634
I created a branch wrapping every error occurrence of the error "Regular expression too large" that seems to happen when a very large text is used as search input.
In the issue discussion, I highlight that I found references about the error in the chrome/v8 bug tracker, but, as far as I know, they should be resolved in the version of Electon we are using (maybe it is just a related bug).
#7634 (comment)
Also, I open the PR to discuss the best way to handle the error in cases like this. From what I understand that are different ways of logging in the application, and I wasn't sure which was the best approach for this case, so I went with the simplest which is just using
console.error
.Testing:
Using the input from this file (I was just copying the three lines and using them as a single input):
Behavior before this PR:
If the users do not try to create a New to-do or a New note with the searched term still active in the status bar the bug does not appear to occur.
In the image, the search term is still in the search bar, if I try to create a new to-do or a new note from the File menu or from the buttons beside the search input the application will crash
Behavior after this PR:
The error message that is generated