-
-
Notifications
You must be signed in to change notification settings - Fork 443
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: Xapian crash scenarios. #3885
Conversation
* Enhanced retrieval of suggestion lists from libzim. * Implemented task cancellation if the fragment is not visible. * Refactored getVisibleResults into a suspend method to ensure efficient job cancellation. * Handled exceptions thrown by coroutines. * Transitioned to Kotlin Flow instead of Flowable after making getVisibleResults suspend. * Employed lifecycleScope for coroutine launch to prevent unnecessary calls when the fragment is hidden.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3885 +/- ##
============================================
- Coverage 53.54% 53.54% -0.01%
+ Complexity 1402 1396 -6
============================================
Files 301 302 +1
Lines 11569 11588 +19
Branches 1526 1527 +1
============================================
+ Hits 6195 6205 +10
- Misses 4376 4381 +5
- Partials 998 1002 +4 ☔ View full report in Codecov by Sentry. |
…s cancelled before requesting suggestion results from libzim. * Enhanced the loadMoreSearchResults method to accommodate this modification. * Refined the render method to effectively cancel any previously running tasks upon its subsequent execution.
…concurrency issues. * Applied mutex locking in the SearchState class to ensure safe access to search results when users search for different terms.
* Testing the render method with different scenarios to ensure that libzim do not crash due to broken call stack.
@MohitMaliFtechiz Thank you for the fix and the hard work. Does this PR has any other impact for the users (positive or negative) beside fixing the crash scenario? @MohitMaliFtechiz Does this PR impacts #2505 as well? |
@kelson42 No it will not impact the user, it only fixes the crashing scenario.
@kelson42 This PR is for suggestions, and we are now fully using the coroutines for searching the suggestions from the zim file. But #2505 is related to |
Fixes #3877
getVisibleResults
into a suspend method to ensure efficient job cancellation.