I am very saddened by what has happened to you. We try to warn our users about the danger of third party plugins and to have a backup system for your important notes.

2 Likes

I have identified the reason for this and will be filing an issue with the plugin author.

1 Like

Should we disable this plugin first?

You should do that until the plugin author updates the plugin. Meanwhile we have issued a deprecation that should automatically disable this plugin for most people in the next few hours.

1 Like

The 2 cases in discord did not have the checklist (todo|text-based gtd) enabled though? Or the other case maybe due to the Obsidian save process?

Still haven’t found conclusive evidence of what the other two are caused by. So far there hasn’t been any reports of data loss while not using any community plugins.

1 Like

Glad to hear there is progress on finding the root cause of this sad/frustrating problem. I really appreciate your efforts to track this down @Licat !

I for one did not have the Checklist plugin enabled. So for me that is not the final answer. But, do you think one of the other plugins from my list could have suffered from the same vault.read bug?

I have searched through the code of all plugins using GitHub and identified 2 more plugins doing something similar, but none of those are in your list. (They are obsidian-query-language and obsidian-text-expand)

I have filed issues on their github repos as well.

1 Like

Oh. Hmm. @Licat I actually do have Obsidian Query Language installed (but it’s deactivated). I believe it was inactive at the time of my data loss, but to be completely honest I am not 100% certain. So that may be the root cause after all. In any case, it’s certainly disabled now.

Can disabled plugins cause any problems?

1 Like

Disabled plugins shouldn’t affect the app. Obsidian Query Language is also a display-only plugin I believe, as it does not attempt to write files back to disk, so it shouldn’t be a cause for data loss.

1 Like

:open_mouth: I love this plugin. I’m so glad that the dev already seems to be working on it at https://github.com/delashum/obsidian-checklist-plugin/issues/22

Thanks for finding the issue!

1 Like

Hi @Licat

I see on github that the developer has an updated version (1.0.11), but I can’t re-activate the plugin?

Thanks

We’re waiting for the plugin author to re-submit the plugin so we can take another look just to make sure things are in order.

Thanks. I hope he does it soon as I use it daily :slight_smile:

So in the release notes for 0.11.4 it says

But in the app itself, in the hotkey definitions, it’s worded much more strongly as “reload app without saving”.

So is this command considered very dangerous now? I never knew the cmd/ctrl R was destructive until now…

1 Like

yes, it is destructive. I always told people not to use ctrl-r. Under normal circumstance, you should not use ctrl-r. Only plugin dev, maybe theme dev may need to refresh the app.

Hm. Looks like several people fell afoul of the issue I was chatting w @Licat on discord about, i.e. transactional access to vault file modifications. This is partly a documentation issue, but it would probably help a lot to have an API like vault.modify(file, old, new), where the only way to rewrite an existing file is to pass in the contents you expect it to have on disk. This would be a built-in check against stale or empty cache values, not to mention a lot of race conditions. Then the existing vault.write could be deprecated and phased out.

Optionally, such an API could work by opening the file on disk, locking it, then reading its contents to check, before modifying the contents. (And performance could potentially be improved by only writing from the changed portion… which for the majority of writes – i.e. while someone’s typing – would be at the end of the file.)

1 Like

How much is your computer’s RAM and your vault’s size?

We will add an internal file recovery system in an upcoming release to mitigate these data loss issues.

2 Likes

@WhiteNoise That sounds useful, glad to hear this. I just had another zero-byte file pop up on 0.11.6 with very few plugins enabled. I had recently triggered a reload from the command palette (was working on CSS) but I wasn’t in the middle of editing any data etc. Weird.