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

Filter with multiple in conditions for the same property breaks #346

Open
Ma27 opened this issue Nov 5, 2024 · 5 comments
Open

Filter with multiple in conditions for the same property breaks #346

Ma27 opened this issue Nov 5, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Ma27
Copy link
Contributor

Ma27 commented Nov 5, 2024

Description

Given the following filter

labels in Foo || (labels in Recurring && dueDate < now+10d)

I get the following error:

The task filter value 'Recurring' for field 'labels' is invalid.

I added a log.Warningf statement to the code and it gives me

Nov 05 16:17:36 vikunja vikunja[17088]: 2024-11-05T16:17:36Z: WARNING        ▶ 143 haiya strconv.ParseInt: parsing "Recurring": invalid syntax

The workaround for me was to write labels in <id of label 'Recurring'> and the filter works as expected.
When re-opening the filter editor, I even get label in Recurring rather than label in 8 shown.

Vikunja Version

0.24.4

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Yes.

Screenshots

No response

@kolaente
Copy link
Member

kolaente commented Nov 5, 2024

Are you using this in the API or in the web UI?

@Ma27
Copy link
Contributor Author

Ma27 commented Nov 6, 2024

Are you using this in the API or in the web UI?

Reproducible via the browser, haven't tested the API.

@kolaente
Copy link
Member

kolaente commented Nov 7, 2024

If you filter only for Recurring, does it work?

Trying to find out if the label is the problem, or the parentheses.

@Ma27
Copy link
Contributor Author

Ma27 commented Nov 7, 2024

Trying to find out if the label is the problem, or the parentheses.

It doesn't seem related to the parentheses: when doing labels in label || labels in label on the demo instance, you'll get the same error.

If you filter only for Recurring, does it work?

Yes.

But keep in mind, I can work around the problem by doing labels in label1 || (labels in N && <another condition here>) where N is the database ID of the second label I want to filter.

@kolaente kolaente added the bug Something isn't working label Nov 7, 2024
@kolaente
Copy link
Member

kolaente commented Nov 7, 2024

Sounds like this only happens with multiple in clauses. I'll take a look.

The api requires ids for the filter, hence the frontend will translate the string labels to ids before making the request. It seems like that's where the problem happens.

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

2 participants