file corruption when moving non-markdown files to folders currently visible in Projects
Closed this issue · 1 comments
What happened?
simple file corruption
I first noticed this after rearranging some files while using a Projects view focused at the root of my vault with subfolders enabled.
I did some file rearranging, then added a boolean property to files in my library with the + Add field
button.
I later noticed that non-markdown files in folders that were recently moved were not opening. Viewing them in notepad showed that the properties section was appended to the top of these files. Editing this out unfortunately did not fix the file.
the more uncertain one
I also later noticed that moving one of these larger folders would cause my entire obsidian app to freeze up on me. From what I can tell no notes were lost, but looking at some of the corrupt non-.md files in this folder, over 13k+ lines of junk were appended to the files, causing Projects to freeze up as soon as this file was detected by a view. I don't know how the junk actually ended up in the header of this file, and was not able to reproduce.
What did you expect to happen?
I expected either:
- for non-.md files to always be invisible to Projects views,
- for non-.md files to be visible to Projects views, but have their property rows grayed out,
- (stretching) for non-.md files to show some non-.md file metadata, such as photo locations/dates, song tracknames, etc.
How can we reproduce it (as minimally and precisely as possible)?
I was able to reproduce the added properties header from a new vault by doing the following:
- Enable the option "files and links" -> "detect all file extensions". (i haven't tested without this option)
- Install the Projects plugin.
- Create any type of non-markdown file and save it to your new vault (I tested both a .png and .pdn file.)
- Create a new folder.
- Create a view looking at this folder, or create a view looking at root and turn subfolders on.
- Move the non-.md file into the folder.
- The non-markdown file should now be visible in your view.
From this point, adding a new property or editing a property next to this file will cause file corruption, as a--- {property} ---
section is appended to the file.
I don't actually know what exactly caused the corruption that put 13k lines of junk in one of the files...
Anything else we need to know?
that i appreciate y'all for making and maintaining this plugin, have a nice day!
Plugin version
1.17.2
Obsidian version
1.5.8
OS
Windows
Oh I see, many thanks! Can reproduce this and will fix. Let's handle the most fatal one first, preventing the non-md file from broken.
Possible solutions
- Ban fs listener recognizing non md files (implemented)
- Ban folder datasource and the writing api for non md files