Skip to content

Error in query evaluation #12546

@Thoompa

Description

@Thoompa

Search first

  • I searched and no similar issues were found

What Happened?

I have a complex query in the form:
{{query (or (task DOING) (and (task TODO) (or [[Page 1]] [[Page 2]] [[Page 3]])))}}
which should filter all TODO tasks but instead it returns every task still in TODO
The query:
{{query (or (task DOING) (and (task TODO) (or [[Page 1]])))}}
works as intended, the error only appears when there is two or more filters in the OR

Reproduce the Bug

  1. Create a query in the form {{query (or (task DOING) (and (task TODO) (or [[Page 1]])))}}
  2. Verify that it works as intended
  3. Extend the final or with more pages e.g. {{query (or (task DOING) (and (task TODO) (or [[Page 1]] [[Page 2]] [[Page 3]])))}}
  4. Verify that instead of only adding more TODO items that match the additional pages, all items in TODO are added to the query result

Expected Behavior

For a query such as: {{query (or (task DOING) (and (task TODO) (or [[Page 1]] [[Page 2]] [[Page 3]])))}}
the only items in TODO that are returned contain references to pages [[Page 1]], [[Page 2]] or [[Page 3]]

Screenshots

Erroneous query:
Image
Equivalent query with correct filtering:
Image

Desktop or Mobile Platform Information

App Version: 0.10.15
Git Revision: 03bcefb
Platform: Mozilla/5.0 (Windows NT 10.0 Win64 x64) AppleWebKit/537.36 (KHTML like Gecko) Logseq/0.10.15 Chrome/140.0.7339.240 Electron/38.4.0 Safari/537.36
Language: en-US
Plugins:

Additional Context

I didn't see any bug reports that mirror this exactly but these two might be a related issue:

  1. Query using 'or' fails, where 'and' succeeds #4779
  2. Cannot query two values in one property at the same time #6860

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions