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

Fix recursion loop in search bar #5351

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

natsoni
Copy link
Contributor

@natsoni natsoni commented Jul 19, 2024

Fixes #5247

The recursion was caused by the following:

Clicking on any item in the search results that does not match any regex, for example the future SegWit version address bc1pfeessrawgf (prior commit 7d7f9b1) would start a loop that never ends.

clickItem(id: number) {
this.selectedResult.emit(this.resultsFlattened[id]);

triggers

selectedResult(result: any): void {
if (typeof result === 'string') {
this.search(result);

triggers (because no regex match)

} else {
this.searchResults.searchButtonClick();
this.isSearching = false;

triggers

searchButtonClick() {
if (this.resultsFlattened[this.activeIdx]) {
this.selectedResult.emit(this.resultsFlattened[this.activeIdx]);

...etc


This PR removes the line that triggers the search back when no regex matches.

@natsoni natsoni requested a review from softsimon July 19, 2024 14:28
@cla-bot cla-bot bot added the cla-signed label Jul 19, 2024
Copy link
Member

@softsimon softsimon left a comment

Choose a reason for hiding this comment

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

tested ACK @ [8c07e3c]

@softsimon softsimon merged commit 4547a27 into master Jul 24, 2024
25 checks passed
@softsimon softsimon deleted the natsoni/fix-recursion-search branch July 24, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"InternalError: too much recursion" when searching for a future SegWit version address
2 participants