-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
Fixed: Version 3.8.0 shuts down after searching for an entry. #3558
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3558 +/- ##
=============================================
+ Coverage 48.99% 49.01% +0.02%
- Complexity 1081 1083 +2
=============================================
Files 285 285
Lines 10448 10459 +11
Branches 1398 1398
=============================================
+ Hits 5119 5127 +8
- Misses 4501 4503 +2
- Partials 828 829 +1 ☔ View full report in Codecov by Sentry. |
@MohitMaliFtechiz If I understand properly, you can now only request suggestions in libkiwix once each 300ms. This is not how this kind of problem should be solved IMO. This will uselessly slowdown things on fast devices and if for any reason it takes more than 300ms, then app will crash. You should:
BTW this pretty clearly a regression, so we had probabky a piece of code handling this. It shoukd be reintroduced, it might have been done appropriatly. |
@MohitMaliFtechiz @kelson42 is right. We should add debounce mechanisms with the help of coroutines flow here in the search. This will allow us to send one request at a given time, and the previous job will cancel. Also, we should add tests for this. |
* Implemented a debouncing mechanism to enhance the handling of search functionalities. This approach is employed to prevent unnecessary data loads from libkiwix, addressing the issue of crashes when users rapidly type and search for results.
7b2d111
to
a1df0fe
Compare
@kelson42, @gouri-panda I have added the debouncing mechanism for search functionality to avoid unnecessary data loading, to test this functionality I have added test cases properly. @gouri-panda can you please re-review this PR. |
* Fixed: `Search action is debounced` test. * Fixed: `SearchState combines sources from inputs` test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MohitMaliFtechiz Thanks 🎉
Fixes #3556
Issue
The application was crashing when users rapidly typed to search for an entry. This was caused by frequent retrieval of search data from libkiwix, and the previous search job not being properly cleared, leading to it being retained in memory and causing crashes.
searchissue.mp4
Logs
Fix
Implemented a debouncing mechanism to enhance the handling of search functionalities. This approach is employed to prevent unnecessary data loads from libkiwix, addressing the issue of crashes when users rapidly type and search for results.
searchissuefixed.mp4