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.82k stars 404 forks source link

Bug report : Dataview query working on desktop does not work on iOS mobile #1259

Open wakatara opened 2 years ago

wakatara commented 2 years ago

What happened?

  1. Installed dataview as community plugin on iPhone app
  2. Opened page on mobile with query that works in Desktop Obsidian and returns results against directory of markdown files with yaml frontmatter
  3. Query on mobile does not return result but gives Dataview: No results to show for table query

DQL

table without ID file.link AS "Name", ping As "Ping"
from "Obsidian/Refs/Peeps"
where ping = "2022w28"
sort "Name" desc

JS

n/a

Dataview Version

Installed 2022-07-13 but not sure how to determine this on mobile

Obsidian Version

1.3.0 (63) API v0.15.6

Device

iPhone 13 Model MLQ63ZP/A

OS

iOS 15.5

AB1908 commented 2 years ago

Can you try a few other queries to narrow down the behavior?

marjoweb commented 2 years ago

I've also had a lot of problems with this. It's not consistent and a PITA to debug. Especially when away from my desktop. From what I've seen it seems that querying frontmatter properties using the "dataview methods" does not always work. I've rewritten my code to instead use the metadata cache, and things seems to be working much better.

The strange thing is that most of the time it actually works perfectly reading the frontmatter via dataview methods, so it's really strange. I'm using and 'id' field that is added by my javascript code to notes to connect them together to some "sub notes", and this is where I'm seeing most of my problems. Notes created on desktop and synced over to mobile shows up in my queries, but when I create the notes on my iPhone they sometimes refuses to show up when I query them. When I run the exact same query on my desktop it works just fine, even showing the notes created on my iPhone.

I have can send a vault that have both queries that fail on mobile and my rewritten ones that work fine. Tell me if it would help...

AB1908 commented 2 years ago

We'll look at your vault later but can you give me steps to repro this? I'm gathering that I should try creating a note on mobile and then query it and it won't be picked up. Is that correct?

marjoweb commented 2 years ago

My problems seems to be related to reading the front matter properties. But I don't know exactly what and when it happens, so I can't give an easy example unfortunately. I did save a copy of my vault before I rewrote my code though. It's a small vault with two pages of interest, my old one that gave me problems and a new that seems to be working fine.

AB1908 commented 2 years ago

I see. Pass it along when you find the time and I'll try to repro.

marjoweb commented 2 years ago

https://www.icloud.com/iclouddrive/0b9tV7AYPPhIpjAqK8cjN2GdQ#16WOH_-_1_1_query_problems

  1. Open note "Alla pass".
  2. Press the "Nytt pass" button.
  3. Select 2_1 or 2_2 template to be created.
  4. The problems described happens for me with 2_1 but not with 2_2 (which I've rewritten).
AB1908 commented 1 year ago

Sorry for being late to this but are you seeing the issue on the latest beta? If so, I'll try giving this a shot over the weekend.

martinjo commented 1 year ago

Unfortunately I can't test this as I'm traveling and only have my phone with me. Managing vaults on iOS is a pain... I tested this a few weeks back and still had problems, so I'm avoiding dataview queries that involves frontmatter properties. I hope that the sample vault I linked above does work to show the problem.