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: Filters "greaterThan" / "greaterThanEqual" treat all input as numbers. #1175

Open
2 tasks done
DerLeole opened this issue Jul 3, 2024 · 2 comments · May be fixed by #1246
Open
2 tasks done

🐛 Bug Report: Filters "greaterThan" / "greaterThanEqual" treat all input as numbers. #1175

DerLeole opened this issue Jul 3, 2024 · 2 comments · May be fixed by #1246
Labels
bug Something isn't working

Comments

@DerLeole
Copy link

DerLeole commented Jul 3, 2024

👟 Reproduction steps

In any collection in the console, try using a String that cant be parsed to a number in combination with a "greater than" or "greater than equal" query.

👍 Expected behavior

The query is executed and documents are shown, similar to how it is handled when "less than" or "less than equal" is used.

👎 Actual Behavior

Error page, and the backend call is executed with null instead of the actual query string.

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Windows

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@DerLeole DerLeole added the bug Something isn't working label Jul 3, 2024
@DerLeole
Copy link
Author

DerLeole commented Jul 3, 2024

The reason is

toQuery: (attr, input) => Query.greaterThan(attr, Number(input)),

@iamAyushChamoli
Copy link
Contributor

iamAyushChamoli commented Jul 29, 2024

Unlike the "lessThan" or "lessThanEqual" filter, the numeric parsing of the input string in "greater than" or "greater than equal" query is apparently causing this error as the strings that cannot be parsed return NaN value to the backend. I've removed the numeric parsing (PR #1246 )to ensure consistency with the "less than" queries which were reported to be working fine.

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
2 participants