Why is my Sync button blue?

I don’t think I’m capable of fixing this myself, so I’m sharing my findings here. If you can’t look into it yourself at the moment, maybe you’ll want to post it on GitHub.


First of all, even when the sync button isn't blue, syncing may still not work properly. That is, regardless of how often you press Y, Anki will never reach a synchronised state and keep modifying the db on every call. I think I've found the reason why this is happening:

Premise: A sync is performed. Now, the local and the remote collection have identical modified timestamps. We prompt another sync.
What should happen: Anki compares the two timestamps and finds that no sync is required.
What happens instead: The frontend runs self.db.execute("update col set mod=?", val) (triggered by collection.save) where val is a fresh timestamp. When the backend compares the local and remote modified timestamps now, the local one is more recent, so a sync is performed.

This happens most of the time, but not always and I can’t provide a reliable way to reproduce it. I’m also not sure why it only sometimes causes the sync button to be blue.

1 Like