-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Migrate bookmarks between books #1043
Conversation
2d3feca
to
0a9584c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1043 +/- ##
==========================================
+ Coverage 39.36% 41.03% +1.66%
==========================================
Files 58 58
Lines 4075 4187 +112
Branches 2245 2303 +58
==========================================
+ Hits 1604 1718 +114
+ Misses 1091 1003 -88
- Partials 1380 1466 +86 ☔ View full report in Codecov by Sentry. |
80b5b1c
to
80a680a
Compare
Ready for a new review. New commit are either There is an open question about overload resolution between |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase&fixup for the next review
@BPerlakiH Looks good to you (in terme of feature and interface)? |
Yes, initially it looks good to me. |
80a680a
to
434becd
Compare
@mgautierfr It‘s important that the piece of code detecting if a new book is available (to amke a bookmark/note update) is public and dedicated, so we can move notes on kiwix android the same way (but in kotlin), see kiwix/kiwix-android#3632 |
434becd
to
9196479
Compare
Ready for new review. |
I have tried to make that by making our internal (new) method public, but in fact detecting that a new book is available is not the same thing that we are doing here. The PR is trying to resolve invalid bookmark, not migrate valid bookmark to new ones. |
9196479
to
9ae7f7c
Compare
Rebased on main and previous fixup commits have been fixed up. New commits start at d41a9ad The questions about surprising behavior of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only looked at the new commits.
For the next (hopefully final) review please fully rebase & fixup the PR (including any fixes addressing the new comments).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I decided to perform a full review on the final changes (rather than commit-wise) in order to increase the chances of the next review being the last one. Here are a few more things that caught my eye:
9ae7f7c
to
39134f6
Compare
Ready for another review. All commits are fixed-up. (macOs failing is new and not related to this PR, seems to be a (broken) update in homebrew) |
39134f6
to
05e1b6b
Compare
Next round of review. I have rewritten the algorithm using input from @veloman-yunkan. It is indeed simpler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pre-approval.
Please include the proposed final touches in the rebase&fixup and let there be green light!
65de5d3
to
be18c03
Compare
Done |
This allow us to internally call thread_safe function from already locked context.
We will need them to test flavour/date bookmarks migration.
If there is no book with the same flavour, but book with same name and different flavour, we do the migration to the other book.
At least, it must be explicitly asked by the user.
On top of modifying the existing test, the commit also make `MigrateBookmark` test fails as `migrateBookmarks` now migrates from `wrong-book-id-noname` to `Dummy id`. Fix will be provided in next commit.
At indexation time, double quote are ignored, so a title as `TED "talks" - Business` is indexed as `ted talks business`. By removing the quotes, we ensure that our title "phrase" is not closed too early and we correctly search for `ted PHRASE talks PHRASE business` instead of `ted AND talks AND business`.
`MigrationMode` was kind of defined in the context of an internal mode used by `migrateBookmark(...)`. But now, with `getBestTargetBookId`, it is broken. This commit fix that and the associated implementation. Now `UPGRADE_ONLY` will make `getBestTargetBookId` return only newer books. and `ALLOW_DOWNGRADE` will return older books only if current book is invalid.
be18c03
to
6b05eeb
Compare
Fix #1037
Contrary to suggested in #1037 (comment), we don't create new bookmark but update existing one (we don't delete bookmark).
If we create a new one without removing the wrong ones, we would create new bookmarks on each migration.