Closed ScottKillen closed 2 years ago
Don't think the obsidian api would permit me to fix this... the modify event listener callback gives me a TAbstractFile
and I simply use that... could be misunderstanding though
need some more time to look into this and consider if it's worth fixing (if even possible)
I probably should have described the behavior using a little more detail:
So it would seem that in this case, fileIsLinked()
is not detecting the link to the original file and a new duplicate link is being added to the daily note, -or- fileIsLinked()
is working and the modify event is maybe passing the wrong file on a copy.
I wonder if listening for the 'create' event would fix this? It seems that all created files should be added to the list anyway.
đ¤
Did some more testing on the latest version:
test
.test
in the file explorer and selected "Make a copy"test 1
in the file explorer.test 1
, even after editing other files which do get added to the daily note.The console keeps spamming this every time I modify the copy:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'some')
at ListModified.frontmatterMetadataContainsTag (eval at <anonymous> (app.js:1:1490278), <anonymous>:166:34)
at ListModified.fileMeetsTagRequirements (eval at <anonymous> (app.js:1:1490278), <anonymous>:151:52)
at ListModified.eval (eval at <anonymous> (app.js:1:1490278), <anonymous>:119:17)
at Generator.next (<anonymous>)
at eval (eval at <anonymous> (app.js:1:1490278), <anonymous>:46:61)
at new Promise (<anonymous>)
at __async (eval at <anonymous> (app.js:1:1490278), <anonymous>:30:10)
at ListModified.onModify (eval at <anonymous> (app.js:1:1490278), <anonymous>:102:31)
at t.e.tryTrigger (app.js:1:900700)
at t.e.trigger (app.js:1:900633)
I have attached both of the referenced files.
Edits to test.md
always get added to the daily note. Edits to its copy, test 1.md
, are never added to the daily note.
might know how to fix this... will try when i get home from school
I suspect that the metadata cache i use to get links and tags from a file does not exist initially when you copy a file... explains the error in console (edit: if it keeps spamming minutes after, there might be something else going on... i'll test when i get back)
another issue is that i use the file's name to link to the daily note. this means that duplicate files will have the same link. there's got to be a better way... could try getFirstLinkPath
, i think that's what it's for.
sorry i was unable to think straight yesterday & i said it couldn't be fixed lol. was super tired
@franciskafieh You've got a great plugin here, and you will get tired trying to keep up. Don't stress to the point where it stops being fun. I speak from experience.
The incoming issues and feature requests are because we like what you have done and are taking a vested interest in helping it to be better. No apologies needed!
Also, I tip my hat to you. If I could figure out how to get this working, you'd have my pull request.
user pjeby on the discord told me this...
would solve the wrong link part :D
Did some more testing on the latest version:
1. Created a file called `test`. 2. Verified that the link appeared in the daily note. âī¸ 3. Right clicked on `test` in the file explorer and selected "Make a copy" 4. Checked daily note, but no link was added for the new file. â 5. Selected the new file `test 1` in the file explorer. 6. Modified the file. 7. Checked the daily note, but no link is **ever** added for `test 1`, _even after_ editing other files which do get added to the daily note.
The console keeps spamming this every time I modify the copy:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'some') at ListModified.frontmatterMetadataContainsTag (eval at <anonymous> (app.js:1:1490278), <anonymous>:166:34) at ListModified.fileMeetsTagRequirements (eval at <anonymous> (app.js:1:1490278), <anonymous>:151:52) at ListModified.eval (eval at <anonymous> (app.js:1:1490278), <anonymous>:119:17) at Generator.next (<anonymous>) at eval (eval at <anonymous> (app.js:1:1490278), <anonymous>:46:61) at new Promise (<anonymous>) at __async (eval at <anonymous> (app.js:1:1490278), <anonymous>:30:10) at ListModified.onModify (eval at <anonymous> (app.js:1:1490278), <anonymous>:102:31) at t.e.tryTrigger (app.js:1:900700) at t.e.trigger (app.js:1:900633)
I have attached both of the referenced files.
* [test.md](https://github.com/franciskafieh/obsidian-list-modified/files/8406671/test.md) * [test 1.md](https://github.com/franciskafieh/obsidian-list-modified/files/8406669/test.1.md)
Edits to
test.md
always get added to the daily note. Edits to its copy,test 1.md
, are never added to the daily note.
can't reprod any of these issues... maybe i've already fixed it and didn't push? lmk if the new version works... edit: i want to do one last thing before i release a new feature, and it won't be done until tomorrow... see new comment for a new main.js build that should do the job for now
here's my testing....
EDIT: just to be sure, i used the exact same markdown file (name, contents) and it's working fine
temporary new version: https://www.file.io/liL0/download/YfMEr9TVVq1r
just replace the current main.js file with this. no need to change the manifest.json, since there's no new version yet
âšī¸ File was deleted!
âšī¸ File was deleted!
not sure why, but github won't let me upload a js file! i think i found your discord from the obsidian server, i'll dm it to you there
Got it!
So we have a regression on this new version...It is not taking into account the folder setting in the Daily note plugin...so, it can't find my daily note anymore...
So we have a regression on this new version...It is not taking into account the folder setting in the Daily note plugin...so, it can't find my daily note anymore...
Should be easy to fix
Fixed in https://github.com/franciskafieh/obsidian-list-modified/commit/304e651dfad92ebe54b4f875d1395fe71ad88eec from my tests... going to build and create a new temporary release since I can't access discord atm
@ScottKillen could you try release 1.0.1 for me?
Unfortunately, it still cannot find my daily note.
Unfortunately, it still cannot find my daily note.
that's really odd because it seems to be working for me with the exact same setup...
are there any errors in console?
edit: it better not be my git bugging out again....
whoops, found a bug i need to fix... should not affect the file not being found for you, though. maybe it will fix itself whenever i release version 1.1 somehow..?
I'm not sure why... đ¤
also, another troubleshooting method: could you try pasting this.app.vault.getAbstractFileByPath(moment().format('[Daily Notes]/YYYY/MM-MMMM/YYYY-MM-DD') + ".md")
into console? it should return something like this if that file exists...
otherwise, it may say undefined
Any updates on the issue?
Sorry, I am currently working about 18 hours a day...
Probably won't get time for a few weeks.
That's ok. When you do have time, feel free to test again. No rush! Going to close this for now, since I cannot reproduce, but please re-open if the issue persists on v1.1!
On Sat, Apr 9, 2022 at 1:15 AM Scott Killen @.***> wrote:
Sorry, I am currently working about 18 hours a day...
Probably won't get time for a few weeks.
â Reply to this email directly, view it on GitHub https://github.com/franciskafieh/obsidian-list-modified/issues/12#issuecomment-1093700437, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWLR3ZSGKZOFQ4W7W42PQVTVEEG5VANCNFSM5SOB5VGQ . You are receiving this because you were mentioned.Message ID: @.***>
I did upgrade to the latest release this morning, and so far, I have not seen the weirdness đ
If I make a copy of a note using the file explorer context menu, a second link to the original file is added to the daily note. The expected behavior would be to add a link to the copy.