-
Notifications
You must be signed in to change notification settings - Fork 7
[BUG] Appending to wrong note #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you please send me your output file configuration? Basically, just the rest of your settings pane works. |
Unless I'm missing something, that's in the original screenshot? Output Format is |
You’re right, my bad. |
Sorry, misclick on mobile, lol. I’ll take a look in a few hours |
Alright, last thing: your Daily Notes settings pane, or your Periodic Notes settings if using that plugin Just want to make sure that's setup properly. If it is, I will need to release a test version to help solve this. It seems to be working fine on my machine. |
I do have a bunch of plugins, and I'm more than open to the idea that one or more of them is conflicting, I just don't know which one(s), or how to go about figuring that out (short of very tediously disabling all of them, and then turning them on one at a time. Which I'd love to not have to do) |
I think I’m going to add a debug mode to the plugin. I’ve been meaning to make one for awhile now. I’ll try to get it out tomorrow and we’ll see if it helps. In the mean time, you could try a different vault with just Obsidian List Modified, maybe? If it works there and not in your normal vault, it’s most likely a conflicting plugin |
Ok, so current situation is super weird: I tried disabling plugins in this vault in a binary search (ie, I disabled half of them and tested, then disabled half of what was left and tested, and so on), and got down to the only plugin still enabled is List Modified, and I'm still seeing the incorrect behavior. So I created a new vault, enabled Daily Notes, installed List Modified, and tried to recreate the issue by creating a note for today (2023-10-22), and also creating a note for 2021-09-22. I was able to reproduce the issue twice, but I can't reproduce it consistently. I don't know what was different about the two times I got it to happen. If you add the debug mode, I'll try to collect more info |
That’s super odd.. I’ll try to get debug mode out ASAP. I’ve got a pretty bad flu right now though By any chance, was SyncThing enabled on your second vault, too? I’m wondering if that could be the issue, but honestly, I can’t see how Sync would affect the output file’s location |
Nope, no SyncThing 🤷 Sorry to hear about the flu, hope you feel better soon! |
Sorry for the long delay. I'm about to publish it as a pre-release, which means you will need to use the BRAT plugin or manually install it (video here if you need help). What you're mainly looking for is this part... After you've enabled the verbose mode setting, you should be able to open the dev console as you have done before. Play around with editing files, etc, until you see a message like that or "Log note not found, but should be created automatically. Creating now..." |
Link to pre-release: https://github.com/franciskafieh/obsidian-list-modified/releases/tag/2.2.1 |
Ok, I made a copy of my vault, and installed 2.2.1 with BRAT:
Then I created a brand new empty vault, installed only BRAT and OLM, configured Daily Note to match my real vault (as noted above), and made a Templates folder, an Entries folder, and a Notes folder. I clicked the Daily Note button in the ribbon to create a daily note from the template, and then created two files in Notes, and OLM correctly added them to today's note. Then I created Entries/2021/09/31.md. I closed and re-opened the test vault, and created a new file in Notes, and bingo: it added the list to the incorrect note, with all 3 entries (the one from just now, and the 2 from before): |
that’s super weird.. It seems like moment.js thinks the current year is
2021, or it may be a bug in the upstream plugin I’m using to get daily
notes.. I’m gonna need to add something to the debug mode. I’ll try to get
it done within a few hours
…On Tue, Oct 31, 2023 at 5:25 PM joh6nn ***@***.***> wrote:
Ok, I made a copy of my vault, and installed 2.2.1 with BRAT:
plugin:obsidian-list-modified:938 OLM settings saved.
plugin:obsidian-list-modified:790 --- Writing tracked files ---
plugin:obsidian-list-modified:744 [Obsidian List Modified] Log note found at: Entries/1999/12/31.md
Then I created a brand new empty vault, installed only BRAT and OLM,
configured Daily Note to match my real vault (as noted above), and made a
Templates folder, an Entries folder, and a Notes folder. I clicked the
Daily Note button in the ribbon to create a daily note from the template,
and then created two files in Notes, and OLM correctly added them to
today's note.
Then I created Entries/2021/09/31.md. I closed and re-opened the test
vault, and created a new file in Notes, and bingo: it added the list to the
incorrect note, with all 3 entries (the one from just now, and the 2 from
before):
[image: image]
<https://user-images.githubusercontent.com/1129329/279519064-b391947a-ba7d-42c5-abc2-49c66a631f97.png>
—
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWLR3ZU6OZVHD4U3VI5EHSLYCFUFRAVCNFSM6AAAAAA6F5AY72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBYGA2TSNBUGI>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
My initial guess here is that the upstream plugin has a bug, because it also incorrectly detected 1999 as the current year, and additionally it also incorrectly detects the current month. I feel like moment.js has enough users that if it was the source of the bug, someone would have noticed 🙂 |
Yup, confirmed: liamcain/obsidian-daily-notes-interface#21 It's been broken for directory structures like YYYY/MM/DDD and similar for a long time, it seems. |
good detective work lol. super weird since it was working for me… since it
seems like a lot of people want it fixed but nobodys taken a shot at it, I
could try forking the plugin and figuring it out
…On Tue, Oct 31, 2023 at 6:17 PM joh6nn ***@***.***> wrote:
Yup, confirmed: liamcain/obsidian-daily-notes-interface#21
<liamcain/obsidian-daily-notes-interface#21>
It's been broken for directory structures like YYYY/MM/DDD and similar for
a long time, it seems.
—
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWLR3ZTWVBWABADKA5WW663YCF2G3AVCNFSM6AAAAAA6F5AY72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBYGEYTEMRWGU>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
It looks like there's actually a PR that claims to fix it: liamcain/obsidian-daily-notes-interface#25 It's actually fixing a bug in one of the developer's other plugins (the Calendar plugin), but the underlying issue is the same. I still haven't really wrapped my head around modern JS's functional stuff, but it looks reasonable to me? I think it's dynamically building a RegEx that matches whatever the Daily/Periodic note settings currently are, but I gladly defer to you here |
Looks good and for sure lol. Appreciate you for putting effort into the bug
too. Sorry I’m not being very helpful, on mobile rn. I’ll change the plugin
to depend on that fork and release it in a few hours. Hopefully that will
help
…On Tue, Oct 31, 2023 at 6:31 PM joh6nn ***@***.***> wrote:
It looks like there's actually a PR that claims to fix it:
liamcain/obsidian-daily-notes-interface#25
<liamcain/obsidian-daily-notes-interface#25>
It's actually fixing a bug in one of the developer's other plugins (the
Calendar plugin), but the underlying issue is the same.
I still haven't really wrapped my head around modern JS's functional
stuff, but it looks reasonable to me? I think it's dynamically building a
RegEx that matches whatever the Daily/Periodic note settings currently are,
but I gladly defer to you here
—
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWLR3ZSTJ7PWC63EI54ECYDYCF33HAVCNFSM6AAAAAA6F5AY72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBYGEZDIMJRGE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
No worries! You've been super responsive as far as I'm concerned. Also, you're working for free; I'm grateful that you shared your work to begin with! Me putting in the legwork to make a decent bug report is the least I can do 🙂 |
I'll need to work on this tomorrow as adding this fork as a dependency is way harder than it should be. Sorry for the delay |
try release 2.2.2 for me on BRAT. See if that fixes it |
Ok, one step forward, one step back: Recounting all my steps in case it's relevant. I usually leave Obsidian open in the background, so both my main vault and the from-scratch test vault were still running from the other night. I upgraded OLM in the from-scratch vault, closed it, and reopened it by clicking on the vault icon in the window for my main vault. As expected, it automatically created a new daily, and OLM correctly identified the Daily Note! But: it incorrectly identified what files to list there: I had only just opened the vault, and not created or modified any other files, so there shouldn't have been any files to list. Instead, it listed all 3 files from the notes folder. Both Obsidian and my file browser show the last modified time as Oct 31 for all 3 files 🤷 |
When the console says File created in that screenshot, what file was created? Would you mind sending me your data.json as well? I don't see how this bug could occur, as the logic is pretty straightforward and shouldn't be affected by the daily note location bug if (!lastTrackedDate.isSame(moment(), granularity)) {
displayNotice(
"New day/week/month detected, writing tracked files and resetting..."
);
await saveSettingsAndWriteTrackedFiles();
// this code resets the tracked files in data.json and saves the files
settings.trackedFiles = [];
// current date as known by moment, should not be affected by file path bug
settings.lastTrackedDate = moment().format("YYYY-MM-DD");
await saveSettings();
} |
Edit: this reminds me to add some more specific things to the verbose mode |
The file that was created was the the one with focus in Obsidian: 2023/11 Nov/02.md Here's my data.json. I glanced at it real quick before uploading, and remembered: I turned off "auto create log note", which is reflected in the json. So either there's a bug in the verbose output and it's writing that to the console when it shouldn't, or there's a bug in the automatic file creation logic and it's running when it shouldn't |
Did you edit the data.json at all? It shows no files in the trackedFiles array, so nothing should be written to your daily note... Super odd. Everything is working fine on my end (tracking the right files, note not being created automatically unless told to, etc). If there were problems with this, there would be many other issues open. This didn't happen before the update, right? I don't see how these changes would affect any of this anyway. Could you delete the data.json to give OLM a fresh start? Then, enable verbose mode again. Now it shows the names of created files and stuff as well. I'm honestly super confused since usually I know what I'm doing with my own plugin lol |
Oh wait, the issues with create are my fault. Verbose mode outputs "file created" even if it is not added to data.json (it's filtered out for one reason or another) As per identifying the right files to modify, I could try adding even more test messages to see why each file is identified. But this shouldn't be necessary, and I don't know why you're getting the wrong list of files when the data.json shows no files at all. Maybe try deleting it for now (as I said above) and see what happens |
Sigh. Ok, I apologize, because I feel like I'm taking you down a rabbit hole here: So to make sure that I hadn't unintentionally messed anything up or introduced any weirdness in the previous round of testing, I deleted my test vault and recreated it. Like before, I was able to reproduce the issue one time, but I'm not clear on how 🙁. And now I can't reproduce it again. But while I was trying, I got OLM to insert the list of modified files to the same note twice in a single session. So naturally I wanted to see "what happens when I make a new note now?" and the answer was that it figured out that the list should only be added to the Log Note one time, but it deleted all the content in the note after the note heading 🤷 |
Don't apologize!
I think it does this sometimes, but tmk it's a concurrency issue which is pretty difficult to fix without extra reads to the file and complication. As long as it solves itself, it should be fine in my books
this shouldn't happen. Do you think what you're describing is related to #81? I need to fix that soon anyway |
Yeah, that looks like it's either the same issue, or very closely related |
#81 should be fixed now. try it out and let me know what happens :) |
Nevermind, one second |
Should be good now |
Any updates? Going to close if this issue is fixed |
Hey, sorry for the radio silence, I have been crazy busy the last several weeks and haven't had time to give this the attention it deserves. I'm hoping to get to it this weekend |
No worries |
so, apologies for the long delay in getting back to this So, good news, bad news, good news. Good news: as far as I can tell the initial issue that I opened this ticket for is fixed: in all my testing, OLM now successfully writes to the correct note. Bad news: I'm still seeing issues with symptoms similar to #81 , where content after the insertion is being overwritten/erased. Good news: I can consistently reproduce it!
Also fun: sometimes the inserted content is duplicated. Sometimes it's duplicated in its entirety, and sometimes only one or two lines are duplicated. It doesn't appear to be a rendering issue; opening a different note, and then coming back to the daily note, the duplicated content is still there. I can reproduce this frequently, but haven't figured out specific steps for reproducing it consistently. It's not clear to me whether this is related to the symptoms of #81, or if it's a separate issue Since the original issue is now solved, do you want to move these other symptoms to a new issue (or issues?) |
Hey, happy new year! Hope your holidays were good. Just wanted to check back in on this |
Sorry, I missed the original notification. I’m still on vacation so I don’t
have access to my computer right now. I’ll try to work on this asap. Thanks
for following up
…On Tue, Jan 2, 2024 at 8:46 PM joh6nn ***@***.***> wrote:
Hey, happy new year! Hope your holidays were good. Just wanted to check
back in on this
—
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWLR3ZX5UYHQ45K7DI3ZG4DYMSZ77AVCNFSM6AAAAAA6F5AY72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZUG42TQMZSHA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
No worries, and no rush; enjoy your vacation! |
Sorry for the wait. After my break I had exams. Everything's done now, so I'm back to working on the plugin. |
No worries: our lives have to come before our projects! I hope you did well on your exams 🤞 |
#90 would fix this as it would be way more reliable than headings. Just want to see everyone's opinions before making the breaking change |
This has been dead for awhile, but I'm back to working on it. What's super odd is that the local "fork" of the upstream plugin that was causing the bug is exactly the same as the published version. Basically, I forgot to download the "patch" branch instead of the default. And somehow, your issue is still fixed? I'm trying to replicate it right now with the same daily note format as you, and everything seems good. Super odd. I guess I will just leave it as is for now.... I'm stumped Edit: Talking about the "finding the daily note" bug, not the heading bug, which will definitely be fixed in 3.0. Also, the supposed patch PR won't even build. The contributor messed something up and I haven't had a chance to look into it. |
Closing this for now. If it continues to happen when 3.0 comes out, please reopen |
First Steps
Describe the bug
Links are consistently added to the incorrect note. I've got a vault with the following structure:
Today, I enabled List Modified, with the following settings:
Instead of appending the links to the Notes heading in file Entries/2023/10 Oct/18.md , the links are being appended to Entries/2021/09 Sep/18.md
Expected behaviour
What should happen instead?
links should be appended to the Notes heading in file Entries/2023/10 Oct/18.md
Reproducing
My setup
Steps to reproduce bug
Can you pinpoint when/why this bug happens?
n/a
The text was updated successfully, but these errors were encountered: