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: Application crash caused by "Input dispatching timed out" while retrieving storageDeviceList information in the online library. #4164

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Jan 6, 2025

Fixes #4163

  • Moved the storage device retrieval to the IO thread.
  • Updated the StorageDeviceUtils.getWritableStorage method to a suspend function to ensure execution on the IO thread.
  • Refactored CopyMoveFileHandler, OnlineLibraryFragment, KiwixPrefsFragment, and LocalLibraryFragment to adapt to this change.
  • Optimized storage device retrieval by caching it in the main activity and reusing it across fragments to enhance performance, especially with large SD cards. Because getting it in fragments again and again is quite expensive because when we switch to other screens the previous saved state will lost, and it again tries(when it requires) to get the list of storage devices if we again come back to that fragment.
  • Refactored the CopyMoveFileHandlerTest.
  • Improved the showing of the storage device list.

…e retrieving storageDeviceList information in the online library.

* Moved the storage device retrieval to the IO thread.
* Updated the StorageDeviceUtils.getWritableStorage method to a suspend function to ensure execution on the IO thread.
* Refactored CopyMoveFileHandler, OnlineLibraryFragment, KiwixPrefsFragment, and LocalLibraryFragment to adapt to this change.
* Optimized storage device retrieval by caching it in the main activity and reusing it across fragments to enhance performance, especially with large SD cards.
* Refactored the CopyMoveFileHandlerTest.
* Improved the showing of storage device list.
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 63.49206% with 23 lines in your changes missing coverage. Please review.

Project coverage is 56.95%. Comparing base (3c4614e) to head (7f6f0d4).

Files with missing lines Patch % Lines
...le/nav/destination/library/LocalLibraryFragment.kt 0.00% 11 Missing ⚠️
...ile/nav/destination/library/CopyMoveFileHandler.kt 73.91% 1 Missing and 5 partials ⚠️
...e/nav/destination/library/OnlineLibraryFragment.kt 66.66% 4 Missing and 1 partial ⚠️
...ava/eu/mhutti1/utils/storage/StorageDeviceUtils.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4164      +/-   ##
============================================
- Coverage     56.98%   56.95%   -0.04%     
- Complexity     1517     1522       +5     
============================================
  Files           313      313              
  Lines         13399    13402       +3     
  Branches       1662     1666       +4     
============================================
- Hits           7636     7633       -3     
- Misses         4614     4619       +5     
- Partials       1149     1150       +1     

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

@kelson42 kelson42 merged commit 1e5bc58 into main Jan 6, 2025
30 of 31 checks passed
@kelson42 kelson42 deleted the Fixes#4163 branch January 6, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants