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

'pure query' and 'QueryBuilder.and' different results #950

Open
4 tasks done
catalunha opened this issue Jul 6, 2023 · 1 comment
Open
4 tasks done

'pure query' and 'QueryBuilder.and' different results #950

catalunha opened this issue Jul 6, 2023 · 1 comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@catalunha
Copy link

New Issue Checklist

Issue Description

See the simple query for a range of dates. Or I believe any other query.

  final QueryBuilder<ParseObject> query =
      QueryBuilder<ParseObject>(ParseObject('TableOrClass'));
  final start = DateTime(2023, 06, 25);
  final end = DateTime(2023, 06, 27);

  query.whereGreaterThanOrEqualsTo(
      EventEntity.day, DateTime(start.year, start.month, start.day));
  query.whereLessThanOrEqualTo(
      EventEntity.day, DateTime(end.year, end.month, end.day, 23, 59));
query.query();

The result is as expected. The filter.
Result:
Correct filter

Now the same query but passing through QueryBuilder.and but with the same simple query as before.

  final QueryBuilder<ParseObject> query =
      QueryBuilder<ParseObject>(ParseObject('TableOrClass'));
  final start = DateTime(2023, 06, 25);
  final end = DateTime(2023, 06, 27);

  query.whereGreaterThanOrEqualsTo(
      EventEntity.day, DateTime(start.year, start.month, start.day));
  query.whereLessThanOrEqualTo(
      EventEntity.day, DateTime(end.year, end.month, end.day, 23, 59));

  QueryBuilder<ParseObject> queryAnd =
      QueryBuilder.and(ParseObject(EventEntity.className), [query]);

queryAnd.query();

The result should be the correct filter. But it returns all the data. In other words, it ignores the filter. But the and is pure. Shouldn't it be the same as the previous one?
Result:
all data

Steps to reproduce

any pure query and QueryBuilder.and

Actual Outcome

different results

Expected Outcome

different equals

Environment

Parse Flutter SDK

  • SDK version: 5.1.0
  • Flutter version: 3.10.5
  • Dart version: 3.0.5
  • Operating system version: POP

Server

  • Parse Server version: 4.10.4

Logs

@parse-github-assistant
Copy link

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mbfakourii mbfakourii added the type:bug Impaired feature or lacking behavior that is likely assumed label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants