A program should never be able to delete user data without specifically pressing "delete" and then "yes" to a warning. If it is possible to lose data, the program is broken, simple as that.
Updating the documentation will not prevent this, as the use case the OP describes seems totally logical; the user is not at fault!
resolve Wrote:It's a bit complicated to prevent this clobbering without either having a prompt every time the deck is synced, or expensive comparison operations. The documentation needs updating however, and I should probably add a note to the 'syncing' video to mention this.
Fixing this seems trivial to me, without annoying prompts or comparisons. Assuming each deck has a unique identifier, here's how to fix it in each case:
user: danieldesu, crayonmaster
Problem: Newly blank created deck over-wrote old deck online.
Solution: Don't allow a new deck with a new UID to overwrite an ankiweb one with a different UID, EVER. I can't see a use-case where this would ever be useful? Only decks with the same UID online and offline should be able to sync.
Quick fix: don't allow blank decks to sync.
User: Wills321
Problem: Downloading shared deck over-wrote his local modified copy.
Solution: Downloaded shared decks should be saved as a new file, with a new filename if one already exists.
Quick fix: don't allow user to download a shared deck when they have a populated deck open; the operation should only be allowed when you first open a new blank deck, and should be greyed out once it has more than one card/fact.
User: oregum
Problem: accidenly deleted all cards, then synced.
Solution: Pop-up a "Are you sure?" warning when deleting more than one card.
Also the anki automatically backup mechanism is *exactly* designed to prevent this error-case; why were the backup decks also blank?
Solution: Save a backup deck in the backup directory only when a deck has been modified (cards changed, reviews done), not blindly on every sync.