-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Handling bookmarks from previous zim files #601
Comments
@BPerlakiH Please save ASAP (and update DWDS) app, the ZIM name in your bookmarks. Once libkiwix ready, implementing this ticket will imply relying on the libkiwix for that AND create a migration plan. |
BookmarksThe problemIf a newer version of a zim file is added to an app the bookmarks created with the old zim file won't work anymore. How the bookmarks are working on iOS/macOS?It is an entity in the local database, based on the The
The Custom apps problemOur current solution is enforcing to always use a single file per custom app. It is imported into the DB on launching the app. When we update the zim file and create a new app release, the new zim file will be inserted into the DB next to the old one. The problem we are facing is that the bookmarks will still point to the old file, both in referencing the primary key of the old file (which is no longer loaded), If there's a new app release, but the zim file (it's fileID) remains the same, the DB would not change, and the bookmarks should work as before. Custom apps solutionIn case of an update, we can assume that if a new file is imported, the old entries in the DB should be updated. The following solution has been tested (by manually editing the DB):
Alternatively, since we will only want to use 1 zim file, we could also replace the old zim file in the DB, keeping the bookmark primary key references to the same entry. Kiwix app solutionWhen it comes to zimfiles fetched from our catalog / downloaded by the user, we have even more data available, at the same time we need to support multiple zim files and multiple bookmarks. The Kiwix application starts with around ~3000 zim files, non of them being downloaded (physically available on disk). The user can select and download one of those zim files. They might have different flavours, depending on their content, eg based on language of the content and/or cut down versions such as "nopic" (no pictures included to get a smaller size). To identify a ZimFile and eventually apply an update to it, we have the following information at hand:
Based on the above we should be able to determine if the newly fetched / downloaded file is a successor of an older DB entry, and apply similar changes as in case of a custom app. AssumptionsWe are assuming that the bookmarks created both in the old file and the new file will have the same
TLDRCurrently we have enough data collected and available already to apply a bookmark fixing solution in our future releases, therefore we do not need any additional preparation steps carried out right now. |
For clarity's sake, I'll add some details with openZIM wording:
In other part of the project, we use a combination of those metadata (as Questions:
|
@kelson42 there's a question here about whether to await libkiwix 14 and handle migration via libkiwix or implement a similar swift-only fix in the mean time. At the moment, apple app doesn't use the Bookmark feature of libkiwix at all. |
@rgaudin @BPerlakiH Sorry if it was unclear. The fix of this issue is blocked by kiwix/libkiwix#1043 which is itself last blocker for libkiwix14 release. That said, I hope the fix can already be developed once the fix is in libkiwix main branch. |
@kelson42 I just re-read this ticket. Can you please explain which part of this process (from my list above) is meant to be covered by libkiwix ? |
@BPerlakiH Not absolutly sure to fully understand your question but the full bookmark handling is provided by the libkiwix. Regarding update through file update, there is still a bit of discussion how it will look like. But the migration from current system to libkiwix based one is the responsability of the Swift code. Maybe this ticket can be done in two steps: move to libkiwix handled bookmarks and then integrate bookmark updates through ZIM versions? |
@BPerlakiH Upstream ticket has been implemented and is available in libkiwix nightly. No blocker anymore. If you face difficulties with libkiwix API, please request support of @mgautierfr. |
@kelson42 @mgautierfr please see my observations in #679. |
Thank you for all the details in the PR. I have the feeling we're not clear on the objectives. I recall asking about this: do we want to handle everything-bookmark with libkiwix or do we only want to do the bookmark-reconciliation (if it's possible) ? |
Is it fixed by #688 ? |
Yes, but not really in the right way (using the libkiwix). Main reason why this is still open. |
If we update a ZIM file, the bookmarks created formerly remains linked to to old ZIM file, and stop working.
In case of custom apps, this means losing all bookmarks at each update.
Create a plan how we can improve this on the iOS/macOS side.
Depends on kiwix/libkiwix#1037
The text was updated successfully, but these errors were encountered: