standardnotes / desktop

[Moved to https://github.com/standardnotes/app] A free, open-source, and end-to-end encrypted notes app. https://standardnotes.com
GNU Affero General Public License v3.0
1.4k stars 115 forks source link

items not imported due to error decrypting + conflicted copies after importing #814

Open chaserene opened 2 years ago

chaserene commented 2 years ago

3.8.21, GNU/Linux AppImage

I've had two AppImages running and one of them went silently offline in a strangest way that I won't elaborate on now. I had more up to date notes in that instance. I made a backup of the state of my notes from there. then I exited both instances, started one (at this point I don't know which one because I treat them as fungible). after seeing that the network access is okay there, I imported the said backup. after that, I got the following message:

"Import complete. 25 items were not imported because there was an error decrypting them. Make sure the password is correct and try again."

Screenshot

after this, there were also 10 conflicted copies in my notes list.

my questions and concerns:

  1. what causes parts of my backup to become undecryptable? this is frightening because then who knows, maybe my automated backups too are just partially retrievable...
  2. could you modify this message to display what type of data can't be imported, so at least people can have a guess about what was lost?
  3. how is it possible to get conflicted copies by importing a backup? the source of the backup didn't have conflicted copies, and my understanding so far was that importing a backup completely overwrites the current state of the notes list.
moughxyz commented 2 years ago

Could you try importing your backup into a blank app session, so that we can see what the pure state of the data is?

In most cases that message should only be seen if the backup has 25 items and the password you used to import the file was incorrect. How many items did the backup have?

my understanding so far was that importing a backup completely overwrites the current state of the notes list.

Not so. Importing a backup will apply the data on top of your existing data. If preexisting data differs from the data in the backup, conflicts will be created.

chaserene commented 2 years ago

Could you try importing your backup into a blank app session, so that we can see what the pure state of the data is?

I did. it was the old state of my data. by the way, there were no issues here, all items were decrypted successfully.

In most cases that message should only be seen if the backup has 25 items and the password you used to import the file was incorrect. How many items did the backup have?

the backup has 100+ items so it looks like it could only decrypt some of them?

a suggestion: beginning that message with "Import complete" gives a false sense of success, if the import process had any troubles, it could be more fitting to say "Error: out of the M items you tried to import, N could not be decrypted and were not imported. This could be due to X or Y, please try Z."

Importing a backup will apply the data on top of your existing data. If preexisting data differs from the data in the backup, conflicts will be created.

could you walk me though how this works? so if I already have a note that has the same name or UUID as the imported one but different content, one of them will become a conflict?

moughxyz commented 2 years ago

I did. it was the old state of my data. by the way, there were no issues here, all items were decrypted successfully.

Hmm so it only gives an error when you import the data into your existing account? That's strange.

beginning that message with "Import complete" gives a false sense of success

True, it could be misleading. I suppose we should show a conditional message based on total success or partial success.

could you walk me though how this works?

It's UUID based. If a note with the same UUID as the one being imported exists, the contents will be compared, and if they differ, a conflict will be created.