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

Fixed the app crashes that occurred when deleting letters in a search. #3592

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

MohitMaliFtechiz
Copy link
Collaborator

Fixes #3581

  • Removed the unnecessary estimation matches call on libkiwix, as we do not need this since libkiwix can handle this automatically.
  • Cancelled the previously running job if a new searchTerm is in progress; this will avoid unnecessary memory allocation and data load on libkiwix.

MohitMaliFtechiz added 2 commits December 11, 2023 18:04
* Removed the unnecessary estimation matches call on `libkiwix`, as we do not need this since `libkiwix` can handle this automatically.
* Cancelled the previously running job if a new searchTerm is in progress; this will avoid unnecessary memory allocation and data load on libkiwix.
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (1a13516) 48.94% compared to head (a07bb68) 48.98%.
Report is 1 commits behind head on develop.

Files Patch % Lines
...rg/kiwix/kiwixmobile/core/search/SearchFragment.kt 66.66% 0 Missing and 5 partials ⚠️
...x/kiwixmobile/core/search/viewmodel/SearchState.kt 55.55% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3592      +/-   ##
=============================================
+ Coverage      48.94%   48.98%   +0.03%     
- Complexity      1088     1092       +4     
=============================================
  Files            285      285              
  Lines          10495    10502       +7     
  Branches        1404     1406       +2     
=============================================
+ Hits            5137     5144       +7     
+ Misses          4528     4527       -1     
- Partials         830      831       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as draft December 12, 2023 05:47
… This enables proper clearing of the first running job before executing a new one. By implementing this approach, we ensure that access to the libzim search results occurs one at a time, resolving the crashing issue caused by multiple attempts to access libzim resources.

* Replaced the `cancel` function for the Job with `cancelAndJoin`, ensuring that it thoroughly cancels the first job before initiating the new task.
@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as ready for review December 13, 2023 05:55
@MohitMaliFtechiz
Copy link
Collaborator Author

@gouri-panda This PR is ready for review.

Copy link
Collaborator

@gouri-panda gouri-panda left a comment

Choose a reason for hiding this comment

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

@MohitMaliFtechiz Thanks 🎉 !

@kelson42 kelson42 merged commit d65265b into develop Dec 14, 2023
9 of 10 checks passed
@kelson42 kelson42 deleted the Issue#3581 branch December 14, 2023 06:41
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.

App crashes when deleting letters in a search.
3 participants