Skip to content

Bugfix: fix some issues with kobo sync #3352

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xdgc
Copy link

@xdgc xdgc commented Apr 3, 2025

Kobo sync's logic is incorrect, and looks like it pretty much always has been. This is seen on initial sync of a freshly reset device against c-w configured to sync all shelves. I have 1500+ books to sync, but c-w syncs only about 250 or so before saying it's done. That's two full batches of 100, followed by a partial batch.

The problem is in the way the query performs paging. On the first pass it discovers all the books that need to be synced. On the second pass it does pretty well. Third pass, it does badly. All this is because of the way it currently detects which books have been modified since last sync. As it goes through the sync, this query result set gets progressively smaller, incorrectly.

I've tried to repair the logic, and what I get now works perfectly for my case. I'm not 100% sure it's exactly right but it's doing a lot better now for both initial sync and maintenance sync.

I had trouble understanding what was going on in kobo.py initially, so I also updated some of the logging to help out. This should be seen as a net improvement, though not strictly necessary.

Kobo sync's logic is incorrect, and looks like it pretty much always has
been. This is seen on initial sync of a freshly reset device against c-w
configured to sync all shelves. I have 1500+ books to sync, but c-w syncs
only about 250 or so before saying it's done. That's two full batches of 100,
followed by a partial batch.

The problem is in the way the query performs paging. On the first pass
it discovers all the books that need to be synced. On the second pass it
does pretty well.  Third pass, it does badly. All this is because of the
way it currently detects which books have been modified since last sync.
As it goes through the sync, this query result set gets progressively
smaller, incorrectly.

I've tried to repair the logic, and what I get now works perfectly for
my case. I'm not 100% sure it's exactly right but it's doing a lot
better now for both initial sync and maintenance sync.
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.

1 participant