ryanjamurphy / review-obsidian

Add the current note to a future daily note to remember to review it.
140 stars 8 forks source link

Unable to create note #25

Closed CarloLoTelit closed 3 years ago

CarloLoTelit commented 3 years ago

In version 1.6.2 on Windows 10 if a daily note already exists, the plugin is unable to add a new review item

patrickcjwall commented 3 years ago

Yes I am also having this issue (also v 1.6.2 on Windows 10). Any idea of a fix/workaround? For the moment I am setting to review on a date that doesn't yet have a note and then copying to the note I really want but this is not a permanent solution

ryanjamurphy commented 3 years ago

Hm. Sorry for the trouble. I'm struggling to reproduce this issue, however. Can someone pull up the console (cmd/ctrl+alt/opt+i, then click the Console tab at the top) and reproduce the issue to see if any errors are reported?

Thanks!

patrickcjwall commented 3 years ago

Thanks @ryanjamurphy -- I'm quite new to Obsidian and that key combination isn't doing anything...is there another way to get to the console?

ryanjamurphy commented 3 years ago

What operating system are you using, @pwal2425? Note that if it's macOS, the key command should be cmd+opt+i. If Windows, it's ctrl+alt+i.

patrickcjwall commented 3 years ago

Windows 10 and Obsidian v.0.12.3. cmd+opt+i isn't doing anything...

ryanjamurphy commented 3 years ago

Windows 10 and Obsidian v.0.12.3. cmd+opt+i isn't doing anything...

D'oh, sorry, I had it wrong! It looks like it's ctrl+shift+i on Windows.

patrickcjwall commented 3 years ago

Ah great. This is what the console said when i set '- [ ] Test line' for review today (which already has a daily note called '2021.05.12 Wednesday «Plan»'

Checking for block: main.ts:97 Checking if line '- [ ] Test line' is a block. main.ts:101 Checking block ^kvmd2zv main.ts:97 Checking if line '- [ ] Test line' is a block. main.ts:101 Checking block ^kvmd2zv main.js:246 Failed to create file: '009 Timestamped/2021.05.12 Wednesday «Plan».md' Error: File already exists. at t. (app.js:1) at app.js:1 at Object.next (app.js:1) at s (app.js:1) createDailyNote @ main.js:246 async function (async) createDailyNote @ main.js:218 eval @ main.ts:188 step @ tslib.es6.js:102 eval @ tslib.es6.js:83 eval @ tslib.es6.js:76 __awaiter @ tslib.es6.js:72 Review.setReviewDate @ main.ts:114 eval @ main.ts:273 (anonymous) @ app.js:1 app.js:1 Uncaught (in promise) TypeError: Cannot read property 'path' of undefined at t. (app.js:1) at app.js:1 at Object.next (app.js:1) at app.js:1 at new Promise () at o (app.js:1) at t.read (app.js:1) at Review.eval (eval at (app.js:1), :733:64) at step (eval at (app.js:1), :72:23) at Object.eval [as next] (eval at (app.js:1), :53:53)

patrickcjwall commented 3 years ago

And this is when I set 'Test line 2' for review on a date that does not yet have a note:

Checking for block: main.ts:97 Checking if line '- [ ] Test line 2' is a block. main.ts:101 Checking block ^kvmd2zv main.ts:97 Checking if line '- [ ] Test line 2' is a block. main.ts:101 Checking block ^kvmd2zv main.ts:121

ryanjamurphy commented 3 years ago

Thanks. It's not clear why this is happening. Still, I just tried a couple of things—update to 1.6.3 and let me know if you see the issue again.

samthom commented 3 years ago

Using Version 1.6.3 With Obsidian v0.12.3 (In Linux) The same issue persist. Don't know about macOS and Windows.

ryanjamurphy commented 3 years ago

A question for everyone here: What is the format for your daily note filename?

@pwal2425, I've located your error: you cannot use periods (.) in filenames. That's causing issues with finding the right path for an existing file. I don't think I can fix this, because I'm not doing anything special when writing to these files—just using Obsidian API calls. I recommend changing your format to use e.g., dashes (-) or something else. Sorry for the trouble.

patrickcjwall commented 3 years ago

Ah. Thanks. Yes I use YYYY.MM.DD for my daily note.  Do you know why this only just started happening?

ryanjamurphy commented 3 years ago

The timing's hard to pin down, as there's a number of things that could have changed. Ultimately, though, I'm not sure why it ever would have worked. I think this function is handled by the Daily Notes Interface created by @liamcain—Liam, do you have any quick guesses as to why users can no longer use . in the filenames?

liamcain commented 3 years ago

@ryanjamurphy, hmmm looks like that could be an issue on my end. I can take a look.

samthom commented 3 years ago

@ryanjamurphy I'm using DD-MM-YY format for my daily notes. The first time when I add a note for review it works. New note get created with review section below my template. But if I tried to add another note to same day it shows unable to create new file Basically I am not able add notes for review if the daily note file exist for that day.

Do you want me to open a new issue, Since mine seems to be a different issue ?

ryanjamurphy commented 3 years ago

Hmm. @samthom what's your console saying when it fails? What is the folder path for your files?

samthom commented 3 years ago

image

My daily notes path is /home/samthomas/Cloud/System Sync/Notes/Second Brain/Resources/Zettlekasten/Daily . If you're concerned about the privileges, The first time when I add note for review it's working.

patrickcjwall commented 3 years ago

@ryanjamurphy I am currently using the Daily Note core plugin, as opposed to the one through the periodic notes plugin (though I do use the periodic notes plugin to create weekly notes). So far this approach has not caused problems, but perhaps it is part of the issue here?

ryanjamurphy commented 3 years ago

@pwal2425 You could try disabling the Daily Note core plugin and using only Periodic Notes (the functionality is equivalent). I don't think it's your issue, but it's worth a shot.


@samthom The plugin (1) checks for a file that matches the filename of the daily note. (2) If it finds no such file, it creates one. (3) If it does find a file, it appends to it.

So the problem's likely in (1). Something about your set up is causing the plugin to fail to find the existing note. Is this problem new for you? Did it work previously? If so, when did it change/any guesses as to what might have changed?

samthom commented 3 years ago

No I recently started using this setup with review plugin and periodic notes. I disabled daily notes core plugin after the setup. image This is my periodic notes setting for daily notes.

ryanjamurphy commented 3 years ago

@samthom

  1. Does the Daily Note Template file end in .md? It might just be cut off in the screenshot.
  2. Is there a chance you could have multiple files named e.g., 19-05-21? I doubt it, but it would mean you don't have uniquely-named files...
samthom commented 3 years ago

@ryanjamurphy

This is my template file Templates/Periodic Notes/Daily Note.md And I tried without the template, Problem persists without template also.

No there's only single file 19-05-21 as you can see below. image

CarloLoTelit commented 3 years ago

I have the same error log reported here and according to this note I looked at how the target file name is picked -> enabling debug logs it seems that the plugin looks for a file with dd.mm.yyyy format, which is different than the format I use for my notes (which is yyyy-mm-dd), that's why the plugin fails at finding the file at first.

immagine

The problem however is in my Natural language Dates plugin's configuration, where the "Date format" entry was set to "dd.mm.yyyy" instead than "yyyy-mm-dd", so it was impossible for Review plugin to find the proper file name.

If this is confirmed by the others, I believe we can close the issue since it's not due to Review plugin.

samthom commented 3 years ago

@ryanjamurphy @CarloLoTelit
Thanks, I changed Natural language dates date format. now it works fine.

ryanjamurphy commented 3 years ago

Amazing! Thanks for your detective work, @CarloLoTelit, and thanks all for your diligence here.

@pwal2425 Have you had any luck? I would love to close this issue.

patrickcjwall commented 3 years ago

Yes! Resolved. I had actually checked this as one of the very first possible issues and to the naked eye there seemed not to be a difference, but I copy-pasted for good measure and now it seems to work. Perhaps there was a trailing space or something that I hadn't noticed.

patrickcjwall commented 3 years ago

Related to this though, would it be possible to modify the input coming from natural language dates for review? The situation for me is this:

But maybe too tricky to do? Please let me know if you would prefer me to open another thread for this.

ryanjamurphy commented 3 years ago

Closing this thread! @liamcain just to summarize, it's not an issue with the interface. Sorry for the distraction!

Thanks all!