akosbalasko / zoottelkeeper-obsidian-plugin

Obsidian plugin of Zoottelkeeper: An automated folder-level index file generator and maintainer.
182 stars 11 forks source link

DATA LOSS BUG: Zoottelkeeper is deleting files #50

Closed brimwats1 closed 2 years ago

brimwats1 commented 2 years ago

I had to chase down an incompatibility with Zoottelkeeper and Folder-Note today you can see my initial report here: https://github.com/aidenlx/alx-folder-note/issues/41

To reproduce:

  1. Have Zoottelkeeper, folder note core and alx-folder-note.
  2. Make a folder.
  3. Add the Zoottelkeeper "template" things into folder note's template (i.e. %% Zoottelkeeper: Beginning of the autogenerated index file list %%)
  4. Place the name of folder in Zoottelkeeper's "exclude" section
  5. Try to make a folder note folder.

You will get

no afitem found for path 000 - Landing Page. Inbox. KO. Meta/000 - Landing Page. Inbox. KO. Meta.md, escaping...
_setMark @ VM256:171

6, Zootelkeeper will delete the note

  1. Meanwhile, if this was a folder that was renamed, thousands of these errors will be logged:
getFolderPath(tbasename: "QuickAdd"deleted: falseextension: "md"name: "QuickAdd.md"parent: t {deleted: false, vault: t, path: "/", name: "", children: Array(10)}path: "QuickAdd.md"saving: falsestat: {ctime: 1634975230244, mtime: 1638123400523, size: 1997}unsafeCachedData: "---\nMetadata: \nfileClass: Meta\nMetaType: PKB\nCreated: 2021-10-23 00:47:10\nLast Modified: 2021-10-28 01:43:05\n---\n# QuickAdd\n\n- 1635613559: \n- 1635613560: \n- 2021-10-30 10;12:02: test\n- 2021-10-31 03:39:54: test\n- 2021-11-06 17:21:[second - \n\n- 2021-11-06 17:24:34 -  \n- 2021-11-06 17:26:14: \n- 2021-11-06 17:27:44: ---\nhttps://news.ycombinator.com/item?id=29135559\n\nbarrenko 1 hour ago
((MORE NOTE CONTENT HERE))
? \n"vault: t {_: {…}, fileMap: {…}, config: {…}, writingConfig: false, configDir: ".obsidian", …}__proto__: e): note name invaild
brimwats1 commented 2 years ago

(this would be avoided if zootelkeeper allowed templates, as suggested in #17 —the folder-note template is a workaround for this

akosbalasko commented 2 years ago

Hi @brimwats ,

I was hardly able to reproduce the problem, the only constellation when this deletion happened if I set the excluded folder wrongly in Zoottelkeeper config: assuming that I want to exclude FolderA in the root, the correct path is /FolderA, not just FolderA, in this latter case the index file is going to be removed and not filled again. So, let me close this issue, pls correct the excluded folder path. Btw: currently I'm implementing templates, but it's a bit hard, because Templater plugin looks a bit buggy.