Open chmac opened 2 years ago
Thanks for reporting the bug. We will look into this and update you when it is done 🙏
@hikchoi (or whoever looks at this one)- this is likely due to a race condition with the file watcher not propagating file changes from git pull
to the engine in time (or perhaps the updates never made it at all).
On quick inspection - we should probably strengthen the check if the note already exists
check here to also do an fs-extra file system check: https://github.com/dendronhq/dendron/blob/86482b74d2916658fab4bf8e3e3897436edbade6/packages/engine-server/src/drivers/file/storev2.ts#L1063
Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)
Describe the bug
If I
git pull
a vault, and then immediately switch to dendron and hit cmd+shift+i, the journal note that was just pulled is sometimes overwritten.To Reproduce
Steps to reproduce the behavior:
git push
git clean -f && git pull
git status
shows the note changedExpected behavior
Dendron should never overwrite a file on disk with an empty template, even if that file has not arrived in the dendron index, or otherwise.
Additional context
I think this requires pretty quick switching back and forth between the terminal and dendron. I've now seen it happen on several occasions. But always with the same flow, I open the journal, realise I started today's journal on another machine, switch back, git pull, and then my journal gets wiped.