Card due dates changed on sync

@dae I’m not sure what exactly happened, but I think I’ve happened upon a bug. I did my flashcards on my phone yesterday, but forgot to sync. This morning I synced my desktop. I now have all the cards from yesterday, plus the cards from today due (despite syncing ankimobile and then re-syncing desktop). When I look at my cards, the cards that are due 3-13-2021 (yesterday) were all reviewed yesterday and it shows it in the info. I’m not sure what happened, but I’ve exported my collection so you can look at it if needed. I had many of the cards in filtered decks, not sure if that has anything to do with it.

Also on a separate note- I noticed that the side days of the week do not line up with the boxes of the heatmap of the stats on anki mobile. (I’m on the beta)

When cards are modified on multiple devices, whichever side was modified most recently wins. It sounds like something marked the cards as modified on the desktop, which caused them to overwrite the review state you had on your mobile. Maybe you are using an add-on that automatically applies changes to cards?

(Could you attach a screenshot of what you’re seeing in the graphs? It seems ok here)

I have no idea what could have changed them (I haven’t added or altered any addons in weeks).

Here’s a picture of what I’m seeing (all the overdue cards show they’re due 3-13 despite being reviewed 3-13)

Yes, that’s what I’d expect to see if something had modified the card on your desktop after you reviewed it on AnkiMobile. The review history syncs separately, so does not get lost when a conflict happens. You say you haven’t changed any add-ons recently, but presumably you are syncing at the start and end of each session usually, which means this wouldn’t tend to occur.

Have you checked your AnkiMobile backups? Perhaps you have one there from after you did you reviews.

I’ll look a bit more into it and see if I can track it down. I am always syncing regularly, but I have made this same mistake in the recent past and this didn’t occur so I didn’t know if that was because of the new anki version or just happenstance

@dae it happened to me again so I reverted to iOS backup and tried again without any addons and it still happened. Reverted to backup again and then tried it on 2.1.41 and it did not happen. Every time I sync from mobile to 2.1.42 it shows my cards as reviewed, but the due date does not change

Please let me know if there’s anything I can do to help troubleshoot that

Hmm, I can’t seem to reproduce this. And if I deliberately review a card on 2.1.42, wait a few seconds and review it on mobile, and then sync desktop/mobile/desktop, the newer AnkiMobile update correctly takes precedence.

Would you be able to send me your AnkiMobile backup and an export of your computer version, and point me to a particular card that is not syncing correctly? No media needed, just the collection itself, which you can export + airdrop to your computer after restoring from the backup.

And when you restore from the backup, are you doing a full upload to AnkiWeb and full download to your computer?

What’s causing the error is 1. reviewing cards on ios (67 cards reviewed, currently showing 0 cards to review) 2. syncing ios 3. syncing desktop. (shows there are 67 cards to review before and after sync). If I 4. sync ios again, then it shows 67 cards to review (instead of 0 from previously)

When I restored from backup yesterday I restored from backup on ios (only had 3 cards left to review on the ios at that point), then force synced upload. I then downloaded on the desktop so they both showed only 3 cards left to review. Then I repeated the process by reviewing the 3 cards on ios, syncing ios, syncing desktop and the same thing happened.

All of this only happens with 2.1.42. iOS version is 2.0.71.8

Here’s the collection from yesterday from deskto and ios: Damien - Google Drive

I can try it again if you need more troubleshooting

Hmm, still no luck reproducing this. I grabbed your AnkiMobile backup which is showing 60-something cards are due, synced it to 2.1.42 and 2.0.72 (which is the latest app store version), and then tried review on mobile→normal sync to desktop and back, but the counts correctly decremented on the desktop each time. Does updating to 2.0.72 make a difference for you?

I’ll test today and let you know!

Tried that and it seems to have worked (didn’t realize their was a 2.0.72 because that wasn’t available on testflight

Hmm, that’s really odd - I went back over the changes in .72, but they’re really minor, and should have no effect on syncing. Glad to hear the issue has resolved itself in any case - fingers crossed it stays that way!

Super weird because I can still reproduce it otherwise. I’ll keep an eye on it and let you know if it ever happens again!

@dae this happened again… unsure what caused it this time

If a pattern doesn’t present itself, I will need to add extra logging so we can track it down.

It still happens without add-ons. I don’t know if its related to filtered decks or not. I usually am rebuilding and emptying decks when I start/end the day. That’s the only thing I can think that may be related since it only inconsistently happens. I’ll keep messing with it

(speaking of future ideas… I use an add-on that lets me rebuild all or empty all and that would be a nice feature to be integrated)

@dae I figured something out! If I review cards on my iOS app, then empty all filtered decks on my computer prior to syncing, it causes this issue.

I’m currently using the rebuild all empty all enhanced fork from @ijgnd , not sure if that is causing the issue or not. I’ll test tomorrow with no addons installed and manually empty all filtered decks and see if the problem happens again
https://ankiweb.net/shared/info/104518886

1 Like

Moving cards to a different deck marks them as modified, and if you then sync to a device that has earlier pending changes, those changes will be overridden with the more recent change. To ensure this doesn’t happen, you need to make sure all changes made on other devices have been synced to your desktop before you do any emptying/rebuilding.

1 Like

Good to know. At least I know the problem now. Is there any way to let end users know about this better? I imagine if it’s been a problem for me, there are probably others that will experience it at some point as well.

Perhaps @ijgnd could just mention it on the add-on page at least?