Anki Forums

Syncing with AnkiWeb downloads entire deck when change is made in local deck

Any sync made after a change in the deck (e.g. after a review) seems to result in a full deck download. This seems to have started occurring after updating to Anki 2.1.29, but persisted after downgrading to several older versions and on another computer with Anki 2.1.26. It also occurs with the latest version of AnkiMobile. I have also tried “Check Database” and “Check Media” several times, and forcing a sync change in one direction.

Are there any sync debugging logs I can view to help me figure out why this is occurring?

One thing that I noticed, which is potentially related is an error with a media reference. When running “Check Media,” I get the output below:

Missing files: ⁨1⁩

Unused files: ⁨0⁩

The following files are referenced by cards, but were not found in the media folder:

Missing: ⁨ "Screen⁩

Weirdly, the end quote is not included in the output, so there could be some kind of corrupt media reference in a note, but I cannot find it.

The issue appears to be a mismatch between the number of deletion records on your devices. Please force a full upload again, and keep an eye on what you’re deleting and on which clients. It may also be worth avoiding AnkiDroid for a few days to see if the issue pops up when it is out of the picture.

Media is synced separately, and will not be connected to this issue.

1 Like

Thank you, I’ll keep trying, stop syncing AnkiDroid, and hopefully it will eventually resolve then. If it doesn’t after a few more days, would it make sense to delete the ~/Library/Application\ Support/Anki2/ folder on a device and do a fresh sync/download?

Just to clarify, if I take the following steps on a single device I still run into the issue, so I’m not sure if there is another way to force reset deletion records:

  1. Force changes in one direction
  2. Sync and upload
  3. Sync on same device again (no issue)
  4. Review one card
  5. Sync again on same device (will seemingly download entire database)

I’ve tried those above steps a few times, over a few days, as well as again just now and it seems to reproduce every time on my account.

What add-ons do you have installed? If you repeat the steps with all add-ons disabled, can you reproduce the problem?

Yeah, the last time (when I sent last reply) I did those steps was with add-ons disabled. I have also done the equivalent of those steps on AnkiMobile (iOS, which shouldn’t have add-ons).

What add-ons do you use? I suspect one of them has changed the collection’s usn, which has broken things. To fix the issue you’ll need to run the following in the debug console, then upload again.

mw.col.db.execute("update col set usn=3000")
mw.col.setMod()

https://docs.ankiweb.net/#/misc?id=debug-console

1 Like

Thanks, that seems to have fixed it. There are a lot:

  • AMBOSS
  • Cloze Overlapper
  • Convert Subdecks to Tag Hierarchy
  • Customize Keyboard Shortcuts
  • External Editor
  • Frozen Fields
  • Hierarchical Tags 2
  • Image Occlusion Enhanced
  • ImageResizer
  • Mini Format Pack
  • Pomodore Tomato Clock Port
  • Postpone cards review
  • Redesign
  • Review Heatmap
  • Search and Replace Tags
  • Special Fields
  • Transfer scheduling data from one card to another

Doing a quick grep on the add-ons directory, it seems that the “Transfer scheduling data from one card to another” add-on sets the collection’s usn so that might be the culprit; I’ll disable it and let them know if it seems like that was the problem:

./94685914/__init__.py:    mw.col.db.execute("update col set usn = -1") # -1 to force sync
1 Like

Yes, please let them know - it should not be doing that.

Please give me a heads up when they fix it and I’ll update the review I posted on the add-on page.

1 Like

A post was split to a new topic: Synchronizing multiple profiles

Hello !

I am the creator of the Transfer scheduling data addon and I am really sorry it broke the sync function @bdesnoyers. With the previous versions, it worked well. I commented the line and it doesn’t break the sync anymore. Thank you @dae for letting me know about the problem. I will put the solution on the main page of the addon.

Thanks, I’ve updated the review.