obsidian-dataview
obsidian-dataview copied to clipboard
[Bug] file.inlinks not working correctly
The list of file.inlinks is frequently missing items.
Judging from the behavior, it feels that the inlinks are being pulled from some outdated cache or something. When I visit the file and click through to the missing inlinks and then retype the reference link, my dataview query shows the list accurately.
Here's a screenshot showing the behavior:
And here's a loom video: https://www.loom.com/share/57d03ef53cdd41b7ba87be49ee6038c1
I can also confirm this.
I think I know what this is - I collect all of the links TO a page once when I first index all of the pages, and then I don't update them again unless you change that specific page. If you link to that page somewhere else, it doesn't update file.inlinks
unless you change the links explicitly.
Confirming I've noticed this same issue. Happened to me when I changed the folder for some files: inlinks
field suddenly dropped all the links to those files. Have been able to get some of them back by retyping the links as @timconnorz and @blacksmithgu mentioned, but this method seems flaky. Doesn't always work.
Note that Obsidian itself continues to recognize all these links, so it's a dataview thing explicitly
It due to file moves (without renames). Dataview stores links as absolute paths, so if you move a path, the links need to be updated; however, the linking files have no reason to update since their content hasn't changed.
Though mildly inefficient, I'll likely just re-queue the affected files for re-indexing which should resolve this issue, given rename operations aren't that frequent.
I can confirm this behaviour on Obsidian 0.14.2 and Dataview 0.4.26. I need a table which shows alle pages which have an incoming link from this page.
TABLE WITHOUT ID
state AS State,
file.name AS Lession,
format,
learning_support,
last_prod_date,
note
FROM "_RMKA/lessions"
WHERE
contains(file.inlinks, this.file.link)
If I add a link to a note under _RMKA/lessions
, it appears in the table.
I expect the table entry to disappear as soon as I remove the link again, but that is not the case. In my desperation, I also try to do manual edits (in the table note as well as the linked note) to "trigger" something (?):
The table only refreshes when I close and reopen Obsidian:
Btw, the incoming link pane of Obsidian always tells the truth and updates on any modification. Any suggestions how to update dataview's cache of inlinks?
Thanks, Simon
(Let me know if I can be of any help to debug this)
I think adding a manual refresh command could help with this.
I reproduced this error, was very weird. Had to quit and restart obsidian for it to update. Anyway to fix this?
Does #998 help?