maltaisn / another-notes-app

Another notes app for Android, like there have been tens of thousands before.
Apache License 2.0
351 stars 36 forks source link

Bug: Importing multiple back-ups #106

Closed dmint789 closed 1 year ago

dmint789 commented 1 year ago

So I am not sure if it's intended to be possible to add multiple backups, but one of two things should be done in my opinion:

I had a back-up of my notes, but I also had the same notes already in the app. I then tried importing the back-up and it removed every single reminder I had set in the app. Many of the notes also got duplicated (presumably due to existing both in the app already and in the back-up). I am not sure if this is being done already, but I think all notes should be identified by IDs and whenever there is a collision of some ID the note from the back-up should override the note already in the app. As for the bug with reminders being removed, I am not sure why that even happens.

Steps to reproduce:

  1. Create back-up while there are multiple notes in the app, some of them with reminders set.
  2. Import the same back-up without changing anything.
  3. There should now be duplicates of notes and reminders should be gone.
maltaisn commented 1 year ago

Merging data is handled like this:

I won't do anything about duplicates because this is the expected behavior. I can fix the reminders disappearing.

dmint789 commented 1 year ago

Huh, that's strange. But if I imported immediately after exporting (I think that's what I did at least), shouldn't the IDs, creation and modification dates all been the same, in which case duplication wouldn't have happened? As for labels, I don't even use them, so can't give any input on that. And thanks, not having the reminders removed would be nice.

maltaisn commented 1 year ago

Actually now that I look again, if both the current note and the imported note have the same ID and last modification date, but a different reminder, then the note is duplicated to avoid losing the other reminder.

Except when comparing reminders, it checks whether the next event is on the same date, which isn't great if some time has passed since export. I changed it to only compare the reminder start date and recurrence.

That may explain the duplication in your case, but I'm not sure why the reminders were lost...

dmint789 commented 1 year ago

Should I try to make some instructions on how to reproduce the issue I experienced?

maltaisn commented 1 year ago

Sure.

maltaisn commented 1 year ago

I'll close this due to lack of information.