Skip to content
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

Bug report #2300

Open
holroy opened this issue Apr 9, 2024 · 14 comments
Open

Bug report #2300

holroy opened this issue Apr 9, 2024 · 14 comments
Labels
bug Something isn't working.

Comments

@holroy
Copy link
Contributor

holroy commented Apr 9, 2024

What happened?

Using Obsidian 1.5.12 and Dataview 0.5.66, it seems like dv.view() fails to render in live preview, but they're working just as normal in reading mode. This is tested in the Sandbox vault with no other plugins installed on Mac Os Catalina. It just shows the - indicator, and no error messages.

DQL

`$= await dv.view("js/test") `

JS

// in the file "js/test.js"

dv.header(2, "test")

Dataview Version

0.5.66

Obsidian Version

Present in 1.5.11 and 1.5.12

OS

MacOS

@holroy holroy added the bug Something isn't working. label Apr 9, 2024
@GottZ
Copy link
Contributor

GottZ commented Apr 11, 2024

can confirm. inline seems to be broken somewhat.

@pierremouchan
Copy link

For me, the issue was coming from the latest iconize version, I had to disable the plugin to make them work again.

@GottZ
Copy link
Contributor

GottZ commented Apr 12, 2024

true but still. I'm not using iconize and have noticed a hard to reproduce related bug with inline queries.

@holroy
Copy link
Contributor Author

holroy commented Apr 12, 2024

In my case it triggers immediately when I add await ... in front of the dv.view() called. So I guess it's related to some asynchronous issue. And no I don't have Iconize plugin installed, so that is not part of my use case. (In either case, I triggered this bug in the Sandbox vault with no other plugins except Dataview.

@josephgarnier
Copy link

josephgarnier commented Apr 13, 2024

I can confirm a similar bug that occurred recently. For my test, I disabled all community plugins, except Obsidian DataView.

When I write $= dv.list(dv.pages()), the Live Preview mode displays <Promise>, while a Reading mode works well.

@holroy
Copy link
Contributor Author

holroy commented Apr 13, 2024

@josephgarnier , neither dv.list() nor dv.pages() by themselves should produce a promise. What else do you do in that query?

In general whenever you get a <promise> return you'll need to add await in front of that call. In your case you might need to use Promise.all().

In any case a promise is not a bug, but when/if the result disappear after adding the await then that's a bug.

@josephgarnier
Copy link

josephgarnier commented Apr 14, 2024

@holroy Just to check, I've just tested a new vault with all default settings and only the "dataview" community plugin. As you can see on the screen below, the instruction $= dv.list(dv.pages()) is displayed <promise> in Live Preview mode only, whereas in Reading mode the instruction works. Furthermore, there are no errors in the console.

Live Preview mode :
image

Reading mode :
image

Now, with the $= await dv.list(dv.pages()) instruction, the display changes, but the result is not as expected: there is no list of files, only one item :

image

edit : actually, the problem persists even with all core plugins deactivated.

@holroy
Copy link
Contributor Author

holroy commented Apr 14, 2024

@josephgarnier , that is indeed very wrong. Something strange has happened in one of the last updates. Neither response is correct when in live preview did that query.

This surely needs more attention and investigation.

@GottZ
Copy link
Contributor

GottZ commented Apr 14, 2024

tomorrow I'm back in my usual debug environment and will try to fix this.

@holroy
Copy link
Contributor Author

holroy commented Apr 14, 2024

Do you have any idea what causes this, @GottZ ?

@GottZ
Copy link
Contributor

GottZ commented Apr 15, 2024

Increasing the compile target to es2022 might have broken code with bad structure. it also broke that server version check earlier.

I got confirmation from an obsidian employee, that es2022 is the correct target these days tho.

I suspect I'll have to do a little housekeeping and re-implenent a few pieces here and there to make sure the code is up to current standards.

@holroy
Copy link
Contributor Author

holroy commented Apr 15, 2024

In other words, the code is going to be unstable for a version of two while working out those kinks? This should then possibly have not been a minor version raise , aka from 0.5.65 to 0.5.66, but rather have gone to something like 0.6.0. This change has caused breakage in many vaults, without been given a proper warning.

This change, alongside with that strange(?) live preview changes/bug in #2216, have broken two of the main use cases in my personal vault so I'm having issues on how to proceed.

And I guess the tests should possibly be extended to catch either of these

@AB1908
Copy link
Collaborator

AB1908 commented Apr 15, 2024

@GottZ should we roll back to previous stable version while we explore fix in beta release?

@holroy
Copy link
Contributor Author

holroy commented Apr 17, 2024

@GottZ should we roll back to previous stable version while we explore fix in beta release?

If we go down that route, which I'm in favor of, should we then also include all the stuff related to #2216 since there isn't any easy fix to that issue, and since it's not very clear which issue was resolved introducing that code at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

5 participants