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: Sometimes not all Bookmarks are showing. #3893

Merged
merged 4 commits into from
Jun 25, 2024
Merged

Fixed: Sometimes not all Bookmarks are showing. #3893

merged 4 commits into from
Jun 25, 2024

Conversation

MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Jun 25, 2024

Fixes #3889

  • We have implemented setHasStableIds(true) in our RecyclerView, which handles data updates efficiently and enhances view recycling. It also provides smooth animations when data is refreshed. However, it requires unique IDs to perform these operations effectively. Since our bookmarks are stored in libkiwix and do not have unique IDs (database IDs), this sometimes results in duplicate data being displayed in the list instead of the actual data, as the lack of unique IDs causes the same data to be repeated when recycling non-visible items.
  • To fix this, we have explicitly provided unique IDs by combining a UUID with the maximum value of a long. This ensures that RecyclerView can efficiently handle large data sets.
  • Added instrumentation test case to avoid this type of error in the future.
  • Fixed DownloadTest, initialDownload. The Library order and zim file name is changed so these test cases are failing so we have implemented a generic approach to not dependent on zim file name.

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as draft June 25, 2024 11:35
* We have implemented `setHasStableIds(true)` in our RecyclerView, which handles data updates efficiently and enhances view recycling. It also provides smooth animations when data is refreshed. However, it requires unique IDs to perform these operations effectively. Since our bookmarks are stored in libkiwix and do not have unique IDs (database IDs), this sometimes results in duplicate data being displayed in the list instead of the actual data, as the lack of unique IDs causes the same data to be repeated when recycling non-visible items.
* To fix this, we have explicitly provided unique IDs by combining a UUID with the maximum value of a long. This ensures that RecyclerView can efficiently handle large data sets.
…ame is changed so these test cases are failing so we have implemented a generic approach to not dependent on zim file name.
@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as ready for review June 25, 2024 17:53
Copy link

codecov bot commented Jun 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.60%. Comparing base (4a6fecd) to head (f209aa6).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3893      +/-   ##
============================================
+ Coverage     53.53%   53.60%   +0.06%     
- Complexity     1396     1401       +5     
============================================
  Files           302      302              
  Lines         11588    11588              
  Branches       1527     1527              
============================================
+ Hits           6204     6212       +8     
+ Misses         4383     4375       -8     
  Partials       1001     1001              

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

@kelson42 kelson42 merged commit 4a30af5 into main Jun 25, 2024
10 checks passed
@kelson42 kelson42 deleted the Fixes#3889 branch June 25, 2024 19:44
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.

Cannot search in Chinese
3 participants