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: Input dispatching timed out in CoreReaderFragment.toggleBookmark. #4129

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

MohitMaliFtechiz
Copy link
Collaborator

Fixes #4127

  • Moved the Book() object creation to lifeCycleScope instead of running it on the main thread. Earlier, it was blocking the UI, especially with large ZIM files. Now, by using lifeCycleScope, it won't block the main thread.
  • Improved the KiwixServer creation process. Server creation was previously happening on the main thread, which could cause the same issue we are facing with adding bookmarks. Because we are creating the same book object while creating the server, which is required for server creation.
  • Updated the behavior of the "Starting server" dialog. Before, the dialog disappeared after validating the IP address, even though server creation was still in progress. Now, the server creation process is moved to the IO thread. For large ZIM files, server creation can take some time, so the dialog will only dismiss once the server is successfully created or if an error occurs. This ensures users are aware that server creation is in progress.
screen-20241210-124326.mp4

* Moved the `Book()` object creation to `lifeCycleScope` instead of running it on the main thread. Earlier, it was blocking the UI, especially with large ZIM files. Now, by using `lifeCycleScope`, it won't block the main thread.
* Improved the KiwixServer creation process. Server creation was previously happening on the main thread, which could cause the same issue we are facing with adding bookmarks. Because we are creating the same book object while creating the server, which is required for `server` creation.
* Updated the behavior of the "Starting server" dialog. Before, the dialog disappeared after validating the IP address, even though server creation was still in progress. Now, the server creation process is moved to the IO thread. For large ZIM files, server creation can take some time, so the dialog will only dismiss once the server is successfully created or if an error occurs. This ensures users are aware that server creation is in progress.
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 46.66667% with 32 lines in your changes missing coverage. Please review.

Project coverage is 58.38%. Comparing base (696087e) to head (3f4fb9d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ava/org/kiwix/kiwixmobile/webserver/KiwixServer.kt 36.36% 12 Missing and 2 partials ⚠️
.../kiwix/kiwixmobile/core/main/CoreReaderFragment.kt 45.45% 3 Missing and 9 partials ⚠️
...wixmobile/webserver/wifi_hotspot/HotspotService.kt 66.66% 1 Missing and 3 partials ⚠️
...org/kiwix/kiwixmobile/webserver/ZimHostFragment.kt 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4129      +/-   ##
============================================
- Coverage     58.55%   58.38%   -0.18%     
+ Complexity     1559     1553       -6     
============================================
  Files           316      316              
  Lines         13532    13544      +12     
  Branches       1722     1727       +5     
============================================
- Hits           7924     7908      -16     
- Misses         4468     4491      +23     
- Partials       1140     1145       +5     

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

@kelson42 kelson42 merged commit 3e197cf into main Dec 10, 2024
21 of 22 checks passed
@kelson42 kelson42 deleted the Fixes#4127 branch December 10, 2024 16:15
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.

Input dispatching timed out at CoreReaderFragment.toggleBookmark
3 participants