Closed tappdesign closed 3 years ago
Some serious changes on that class are already taken in action on #796. I'll try to replicate your issue and adding some changes as the ones you reported and update this issue
I've just pushed commit ed00f89ec02fa0000a468e94c1fdb524afb82add that should avoid some errors while making clearer with logs if something went wrong. Also a false positive backup processing has been managed (so no more "ok everything worked" with missing data).
Would you mind trying if that issue is still there or if you have more info by looking at error logs?
Hi Federico, yes it is there ;) I created pull request just to show the problematic line. After that patch it is working correctly. You can reject it of course, it is just proof of concept.
This happen when imported note already exist in current Database. With my proposal, all attachments assigned to the existing note stays untouched - after import will be (current + backuped) attachments assigned to note. (it is the safe way, data will be not lost). But if we want to discard additional attachments (attached later to the note after backup), my patch is wrong.
It has to be patched in DbHelper.java
it has to be removed by attachmentID, not by the object itself, as it is in current solution:
deletedAttachments.remove(attachment);
Hi Federico,
This is just pretty curious, not sure if you can reproduce it. You can check attached video https://user-images.githubusercontent.com/59613279/103489643-417ead00-4e16-11eb-95ba-cb3eb7f26548.mp4
Just backup all notes, then import it. At a first glance, looks ok, but after restart attachment is lost.
problem could be in BackupHelper.java --> reading old attachments from DB Just look at remarks written in CAPS
the problem could be caused in DBHelper.java in updateNote() function ...(if AttachmentsListOld() are read from DB)
this test is fair complex, not sure if you can confirm it, and my solution is maybe not the correct one, but at least it could solve this issue on my phone.