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 stack overflow when searching in a book with a large TOC #473

Merged
merged 3 commits into from
Sep 2, 2024

Conversation

vitaliynester
Copy link
Contributor

Hello!
When working with a book that has a large table of contents (I attach an example file below), a problem arises with the search. When you try to enter a search query that is not present in the book, the application crashes. I fixed this by rewriting the search function from recursive to a while loop. In my case, this solution helped solve the problem.
The attached epub file has been archived because .epub is not available for attachment: epub file

@vitaliynester
Copy link
Contributor Author

This fix targets version 2.7.2

@vitaliynester vitaliynester changed the base branch from develop to main August 19, 2024 19:33
@mickael-menu
Copy link
Member

Thanks for spotting and fixing this issue @vitaliynester!

Although the main branch is frozen for changes now, would you mind opening a PR targeting develop?

@vitaliynester vitaliynester changed the base branch from main to develop August 22, 2024 22:26
@vitaliynester
Copy link
Contributor Author

Changed to develop

Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

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

@vitaliynester I adapted your changes to the latest develop. But as I couldn't reproduce the issue with the book you shared, would you mind checking my changes before I merge it? Thanks.

@mickael-menu mickael-menu changed the title Bug when searching in a book with a large table of contents Fix stack overflow when searching in a book with a large TOC Aug 27, 2024
@vitaliynester
Copy link
Contributor Author

@vitaliynester I adapted your changes to the latest develop. But as I couldn't reproduce the issue with the book you shared, would you mind checking my changes before I merge it? Thanks.

I apologize for the long response. Yes, after these changes the search works without errors. This is great!

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.

2 participants