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

Migrated Notes to room database. #3863

Merged
merged 6 commits into from
Jun 7, 2024
Merged

Migrated Notes to room database. #3863

merged 6 commits into from
Jun 7, 2024

Conversation

MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Jun 5, 2024

Fixes #3113

  • Now all the new notes will be saved in the room database instead of objectbox.
  • We have added the migration code for previously saved notes from objectbox to room. This will ensure that the previously saved notes will be shown to the user.
  • Added the test cases for testing the migration with different scenarios, and with large data sets. Also, added the test cases for NoteRoomDaoTest, and KiwixRoomDatabaseTest to test that it can save the different types of data.
  • We have refactored our code to use PageDao for managing data related to Bookmarks, Notes, and History. With the ability to return Flowable from the Room database, the BasePageDao interface has become unnecessary. Consequently, we have removed BasePageDao and streamlined our code to use PageDao, providing a unified approach for these functionalities. This change reduces code complexity and enhances readability, making the codebase easier to understand and maintain.

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as draft June 5, 2024 07:19
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 87.05882% with 11 lines in your changes missing coverage. Please review.

Project coverage is 53.87%. Comparing base (a647c15) to head (7966089).
Report is 8 commits behind head on main.

Current head 7966089 differs from pull request most recent head cf58340

Please upload reports for the commit cf58340 to get more accurate results.

Files Patch % Lines
...g/kiwix/kiwixmobile/core/data/KiwixRoomDatabase.kt 28.57% 5 Missing ⚠️
...java/org/kiwix/kiwixmobile/core/data/Repository.kt 50.00% 2 Missing ⚠️
...x/kiwixmobile/core/dao/entities/NotesRoomEntity.kt 95.00% 1 Missing ⚠️
...wix/kiwixmobile/core/main/MainRepositoryActions.kt 0.00% 1 Missing ⚠️
...story/viewmodel/effects/ShowDeleteHistoryDialog.kt 50.00% 1 Missing ⚠️
...ile/core/page/viewmodel/effects/DeletePageItems.kt 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3863      +/-   ##
============================================
- Coverage     53.94%   53.87%   -0.07%     
  Complexity     1383     1383              
============================================
  Files           298      300       +2     
  Lines         11308    11361      +53     
  Branches       1495     1494       -1     
============================================
+ Hits           6100     6121      +21     
- Misses         4222     4252      +30     
- Partials        986      988       +2     

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

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as ready for review June 5, 2024 13:12
@MohitMaliFtechiz MohitMaliFtechiz requested a review from kelson42 June 5, 2024 13:12
* Created NotesRoomDao, and NotesRoomEntity for saving the data in room database.
* Refactored the code for saving the notes in room database.
…ario for notes.

* Refactored the code for a better naming convention.
* We have refactored our code to use PageDao for managing data related to Bookmarks, Notes, and History. With the ability to return Flowable from the Room database, the BasePageDao interface has become unnecessary. Consequently, we have removed BasePageDao and streamlined our code to use PageDao, providing a unified approach for these functionalities. This change reduces code complexity and enhances readability, making the codebase easier to understand and maintain.
@kelson42 kelson42 merged commit 3bd5380 into main Jun 7, 2024
7 of 8 checks passed
@kelson42 kelson42 deleted the Fixes#3113 branch June 7, 2024 04:35
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.

Room migration of Notes
3 participants