notes-android icon indicating copy to clipboard operation
notes-android copied to clipboard

Bug: Data loss on new instance sync

Open Jannik44 opened this issue 2 years ago • 3 comments

Please use GitHub reactions 👍 to show that you are affected by the same issue. Please don't comment if you have no relevant information to add!

Describe the bug

I have set up a new nc instance and logged in via the same username and domain as the old instance, thats why i only had to give access again on the android app, to the same account as before and the sync started, but the notes were partly deleted, on the nextcloud server were only 14 out of around 80 and after that all the remaining notes also dissapeared on the client

To Reproduce Steps to reproduce the behavior:

  1. have a nc instance with notes on the client and on the server
  2. delete that instance and setup a new one with the same account name and domain as before but no notes
  3. go to the notes android app and click on add account
  4. accept the popup
  5. wait for the sunc to finish
  6. see your notes dissapearing Expected behavior

the android app should sync the notes to the server properly without partly deleting notes

Smartphone (please complete the following information):

  • Nextcloud Notes-Version (android app): 4.1.0
  • F-Droid or Play Store: used both
  • Android-Version: 12, Miui 13.0.16
  • Device: Xiaomi Redmi Note 10 pro

Server

  • Nextcloud version:
  • Nextcloud Notes version (server app):

Stacktrace

Jannik44 avatar Dec 26 '23 23:12 Jannik44

Well, of course as a first step import the notes files from the backup you made as the responsible administrator before applying your changes.

But now let's discuss the issue:

the android app should sync the notes to the server properly without partly deleting notes

Seriously, how did you as an administrator think it might be a good idea to misuse a smartphone client as backup source for your server instance?

The Notes Android App handles a new account as a new account and this is (in my opinion) the only way that it should be treated. When switching your account, all data of the left old account gets deleted (the only correct way, who would want to leave data back when leafing an account??), so when the new account gets imported, you will see the list of notes provided by your new account.

Think about any software in general: I think your expection is simply wrong. Just because your account name is the same, it is not the same account. Just think about a Thomas leaving your company and another Thomas joining it: The username may be the same, but it must definitely be a complete other user.

To be honest, I can't see faulty behavior here 🤷

stefan-niedermann avatar Dec 27 '23 08:12 stefan-niedermann

Seriously, how did you as an administrator think it might be a good idea to misuse a smartphone client as backup source for your server instance?

i understand your point, however i cant see why the app should only delete a few notes and not all or neither of them, this makes no sense to me

When switching your account, all data of the left old account gets deleted (the only correct way, who would want to leave data back when leafing an account??)

youre right but why did it upload a few notes to the server then while deleting the rest?

Jannik44 avatar Dec 27 '23 08:12 Jannik44

I agree and this specific behavior might be a bug (or a timing issue / raise condition / whatever). I (as former maintainer and developer of the app) just wanted to make clear that (and why) the expectation to be able to restore everything from the client is not realistic. Feel free to keep this issue open to investigate the falsy behavior you explained above. And of course good luck with your restoration, crossing fingers you have an actual backup of your Notes folder.

Tip: I moved my Notes folder within a folder that is synchronized with my desktop system. That's not a proper backup too, but for my personal needs it's enough.

stefan-niedermann avatar Dec 27 '23 08:12 stefan-niedermann