blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
6.92k stars 408 forks source link

DQL Task Query: Titled callouts cause a shift of results by one #2365

Open tobischiebel opened 3 months ago

tobischiebel commented 3 months ago

What happened?

The below DQL query for uncompleted tasks in a file returns the items one row below unchecked task items. However, this seems to only hold true for when the referenced checklist is contained in a callout that has a title, as when the title is removed the query returns the correct results.

Therefore, in the example below, it returns only B instead of both A and D - as B is the successor of A while D has no successor which could be returned.

DQL

TASK
FROM "File"
WHERE !completed

[!note]+ Test

  • [ ] A
  • [x] B
  • [x] C
  • [ ] D

JS

No response

Dataview Version

0.5.66

Obsidian Version

1.6.3

OS

Windows

WingerathM commented 3 months ago

I can confirm the behaviour and expand on it:

Maybe it is not Dataview, but Obsidians handling of tasks in callouts that is broken?

WingerathM commented 3 months ago

Same problem with dataviewjs: #2359. Seems to be related to the release of Obsidian 1.6.3

claremacrae commented 3 months ago

Hi, I've written documentation for the Tasks plugin about the underlying Obsidian issue which will also be useful to dataview users:

Missing tasks in callouts with some Obsidian 1.6.x versions

I will update the page as the Obsidian behaviour improves.

claremacrae commented 3 months ago

From the Obsidian team:

In version 1.6.5 a new advanced settings has been introduced to force rebuild the metadata cache.

If you are affected by this issue, go to Settings → Files and links → Advanced → Rebuild vault cache.

You will need to do this on all vaults, on all devices...

I've updated the Tasks notes on this issue.

tobischiebel commented 3 months ago

Thank you! How can I do this on mobile? Can find neither "Advanced" nor "Rebuild vault cache" in "Files and links"

claremacrae commented 3 months ago

Thank you! How can I do this on mobile? Can find neither "Advanced" nor "Rebuild vault cache" in "Files and links"

@tobischiebel What version of Obsidian are you running on your mobile then?

claremacrae commented 3 months ago

Here is what it looks like - written up in Tasks:

https://publish.obsidian.md/tasks/Support+and+Help/Missing+tasks+in+callouts+with+some+Obsidian+1.6.x+versions#The+solution+Regenerate+the+Obsidian+metadata+cache

Which says this:

image

tobischiebel commented 3 months ago

Oh, thanks for the pointer, was still on v1.6.3 and didn't realize... Updated the app and now it works even without manually rebuilding the cache :)

claremacrae commented 3 months ago

Oh, thanks for the pointer, was still on v1.6.3 and didn't realize... Updated the app and now it works even without manually rebuilding the cache :)

It may work for some files, but you may not have noticed other locations that were wrong. You should definitely do the rebuild cache thing, if you haven't already!