Fevol / obsidian-criticmarkup

Annotate notes with comments and suggestions using CriticMarkup in Obsidian
MIT License
136 stars 2 forks source link

[BUG] Non-markdown files indexed in database #6

Closed alexinea closed 6 months ago

alexinea commented 7 months ago

I used the Edit History plugin, which creates a xxx.md.edtz file at the same location as the file. Every time I modify the note, it creates an edit history record (compressed), similar to the commit history of Git.

This quite excellent plugin, obsidian-criticmarkup, also takes effect on this xxx.md.edtz file, making it impossible for me to manage note versions. I suggest that the obsidian-criticmarkup plugin could have an include / exclude mechanism so that I can choose which files to take effect / not take effect.

image

The compressed edit history was unexpectedly captured by obsidian-criticmarkup.

thx :)

Fevol commented 7 months ago

Should be relatively easy to implement. There are three different paths I could take:

For each specified filetype, I could:

  1. Disable rendering of suggestion in plugin view
  2. Disable database indexing
  3. Disable criticmarkup rendering

I'll have to investigate the best approach, but I'm probably just going for 2).

Fevol commented 7 months ago

Actually, I had forgotten that the database already only considers markdown files, which makes the fact that this happens a bit weirder. I've tested out the Edit History plugin a bit to see whether I could reproduce this, and I wasn't able to - at least not on the latest version (*.md.edtz file is never indexed).

If you're on version 0.1.4 (latest available version), could you please re-initialize the database in the settings ( ADVANCED: Re-initialize database) to see whether the *.md.edtz still appears?

alexinea commented 7 months ago

image

Yes, I'm currently using 0.1.4 and I reset the database using ADVANCED: Re-initialize database.

My steps are as follows (simulating multiple edits to the same document):

  1. Write the document, then save and switch to Preview mode.
  2. Switch to edit mode, modify the document, press Ctrl + p, "Save current edit in the edit history", and switch to preview mode.
  3. Switch to edit mode, enable "Toggle suggestion mode", modify the document, and leave suggestion mode.
  4. The Edit History plugin automatically creates a version record.
  5. Commentator recognizes the change of the .md.edtz extension file.
alexinea commented 7 months ago

image

I found that when the Suggestion View is in this state, the .md.edtz extension file will be recognized. In other states, the .md.edtz extension file may be excluded.

Fevol commented 7 months ago

Thanks for the additional information! I'm sadly still not able to reproduce this issue.

Could you share me (a slice) of the vault you are using - including the .md.edtz file? I'd like to see if it something specific with the vault, note, or something else.

alexinea commented 6 months ago

Okay, I will send you a Vault tonight so that you can reproduce this bug.

alexinea commented 6 months ago

Test.zip

Hello, I have uploaded the sample Vault.

Create a new Obsidian Vault, and I added "ok ok" at the end:

image

Then restart Obsidian, and we will find that the exception of the edtz file is gone (this may be the reason why it can't be reproduced).

image

At this point, the state of the Obsidian Vault is the same as the state of the uploaded sample Vault.

After opening the sample, open the criticmarkup view, and then select "Accept changes" for "ok ok", an exception of the edtz file will appear (see the figure below).

image

Then please close Obsidian and open it again. You will find that the exception of the edtz file in the above figure disappears in the criticmarkup view:

image

Fevol commented 6 months ago

Many thanks for the detailed walk-through, I appreciate it a lot. I was able to discover the issue rather quickly.

It turns out that I had already fixed this issue in a patch months ago, which hasn't made its way into the release version yet (https://github.com/Fevol/obsidian-database-library/commit/c7187b38790f3fea1a63b495925248b7e5abcd03).

I'm really sorry that I did not realise this sooner, I've been working on the plugin on and off, and haven't diligently checked the git logs (or the proper branch).

alexinea commented 6 months ago

Thank you very much for writing such an excellent plugin:) The obsidian-criticmarkup plugin is currently one of my several most important plugins.

And expecting the new version to be released.

Fevol commented 6 months ago

Thank you again for the bug report and the detailed responses, the new version has now finally been released as 0.2.0.

Please let me know if you encounter any other issues!