mysticcoders / voicenotes-sync

A plugin for Obsidian to sync with the VoiceNotes.com service
MIT License
20 stars 1 forks source link

Task status retention #27

Closed hjamet closed 2 hours ago

hjamet commented 2 weeks ago

As it stands, changes to synchronized VoiceNotes notes are overwritten each time they are synchronized. This behavior is particularly annoying when it comes to tasks extracted from VoiceNotes, which benefit from remaining checked once they have been extracted. More generally, modifications to these tasks (e.g. adding deadlines, repetitions etc.), particularly with the Tasks plugin (https://github.com/obsidian-tasks-group/obsidian-tasks), should also be retained from one synchronization to the next.

So, I think there should be an option not to update the "Tasks" section of synchronized notes if a difference is noticed.

I'll try to work on this task tomorrow in a separate branch if I can find a moment :)

kinabalu commented 2 weeks ago

@hjamet totally agreed, this was an issue someone had brought up a few weeks back and we changed the behavior so that if you had already synced data, unless you selected "Manual sync (overwrite)" it would not touch existing notes.

If you have some further details we can track this down together and of course if you'd like to PR a fix once you've figured it out would be ever grateful!

hjamet commented 2 weeks ago

Thank you from the bottom of my heart for your reply! To be honest, I'm definitely not a javascript developer and this is a first for me when it comes to modifying an obsidian plugin :) So I'm not entirely sure I fully understand the cause of the problem you mentioned! However, I've just made a simple pull request that corresponds to what I wanted. I'll let you have a look and see if it suits your own project design :)

kinabalu commented 2 weeks ago

Re: PR #28 I left a comment and first off thank you for the PR, I think there is more work here to figure out what's really going on -- can we figure out a use case so I can test it here and replicate?

qwertydude commented 2 weeks ago

One possible solution is to have the importer add a checkbox property to the document, such as "Prevent overwrite", that on later imports, the importer can check to see if it's allowed to overwrite.

Or, another method could be, whenever a note is imported, generate a checksum from both the Obsidian version and the VoiceNotes version, and if they differ, prompt user to allow overwrite or keep both.

With a bit more work, probably by saving the checksums, you could alert user which version was changed which version was changed.

kinabalu commented 2 weeks ago

@qwertydude I like both of those as options to force an item to be kept no matter what.

are you seeing this case where the todos are being overwritten during a regular import? as far as I'm aware we had fixed this issue in an earlier PR.

qwertydude commented 2 weeks ago

Not seeing any issue currently with regular import.

kinabalu commented 2 hours ago

This may be related to the voicenotes.com changing the id's from numeric to alphanumeric at some point recently -- closing this for now please re-open if it reoccurs and we can get a good test case together