threeplanetssoftware / apple_cloud_notes_parser

Parser for Apple Notes data stored on the Cloud as seen on Apple handsets
MIT License
412 stars 26 forks source link

Deleted Note shows up in CSV #44

Closed podviaznikov closed 2 years ago

podviaznikov commented 2 years ago

I think deleted note shows up in CSV file. Tried few times and it is still there. Is it possible to not have those? Or is it possible to have some extra column marking notes as deleted.

threeplanetssoftware commented 2 years ago

What folder is listed for the note in the CSV file? My suspicion is "Recently Deleted" and that would be a feature of iOS, not a bug. Instead of an immediate delete, notes get moved to that folder for "30-days" before being actually removed. In practice, I have found that "30-days" might be a bit longer, especially if you don't sync often.

If you are seeing something different, and it lasts for more than a few days after the deletion, please provide specifics. For now, I'm inclined to treat the "Recently Deleted" folder as any other, because technically nothing has happened to that note other than it moved folders.

podviaznikov commented 2 years ago

very weird. It's still has the original folder name. Maybe I'm doing something wrong. I will check few more times tomorrow.

threeplanetssoftware commented 2 years ago

Is the note still present? If so, is this on the local device account, or the iCloud account? If on the iCloud account, has the device synced since deleting?

podviaznikov commented 2 years ago

I have suspicion that it's because of WAL files. I copy sqlite file, but I think I need to copy both sqlite and wal file and make sure everything is committed.

Going to check this and report the results.

threeplanetssoftware commented 2 years ago

Oh, yes that is a likely culprit! My current set of test data behaves differently depending on if I use the full iTunes backup, or just the NoteStore.db file itself because of exactly that reason.

podviaznikov commented 2 years ago

Yeah, I think it was it.

By the way do you know how to automatically backup NotesFiles to some other location. When I run script to copy files I think it works.

But not sure I can run it automatically. Maybe I'm confused but it seems like I'm having issues with System Integrity Protection.

threeplanetssoftware commented 2 years ago

Sorry, I don't use MacOS other than specifically testing this package which I do manually, so I'm not sure the best solution for you. Glad this issue was solved, though!