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

or queries with 2 relation queries (same one, just different conditions) returns 0 objects #1259

Closed
aryelevin opened this issue Mar 29, 2016 · 4 comments

Comments

@aryelevin
Copy link

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Or queries with 2 relation queries (same one, just different conditions) returns 0 objects.
if i run one of the queries alone, i get the objects, so its a issue on the logics somewhere.

Environment Setup

AWS elastic beanstalk
Server v2.2.2

Steps to reproduce

    PFQuery *balanceQuery1 = [[[PFUser currentUser] relationForKey:@"credit_balance"] query];
    [balanceQuery1 whereKey:@"expired" equalTo:@NO];
    [balanceQuery1 whereKey:@"expiration_date" greaterThan:[NSDate date]];
    PFQuery *balanceQuery2 = [[[PFUser currentUser] relationForKey:@"credit_balance"] query];
    [balanceQuery2 whereKeyDoesNotExist:@"expired"];
    [balanceQuery2 whereKeyDoesNotExist:@"expiration_date"];

    PFQuery *balanceQuery = [PFQuery orQueryWithSubqueries:@[balanceQuery1, balanceQuery2]];
    [balanceQuery findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
        objects.count == 0!!!
    }];

Logs/Trace

None

drew-gross added a commit to drew-gross/parse-server that referenced this issue Mar 30, 2016
drew-gross added a commit to drew-gross/parse-server that referenced this issue Mar 30, 2016
@drew-gross
Copy link
Contributor

I wrote a regression test for this behaviour in #1286 that tries to reproduce the behaviour, and the test passes. If you are consistently seeing this issue, can you look at that PR, maybe make a modification that makes the test fail, and open a new issue with that modification?

flovilmart added a commit that referenced this issue Mar 31, 2016
@aryelevin
Copy link
Author

OK, I've checked this deeply, the issues is in the iOS SDK v1.12, which sets the parseClassName property of the or query to the class which where the relation itself stored, it should be fixed so it will be the class of the relation.
Thanks a lot for your assistance.

@aryelevin
Copy link
Author

Actually the issues is that in parse-server, the SDK doesn't gets the target class of an relation column, how that can be fixed?

@aryelevin
Copy link
Author

OK, never mind, I'll open a another issue for that...

flovilmart added a commit that referenced this issue Aug 19, 2016
flovilmart added a commit that referenced this issue Aug 20, 2016
* Adds passing tests

* Better containsAll implementation

* Full Geopoint support, fix inverted lat/lng

* Adds support for $and operator / PointerPermissions specs

* Fix issue updating CLPs on schema

* Extends query support

* Adds RestCreate to the specs

* Adds User specs

* Adds error handlers for failing tests

* nits

* Proper JSON update of AuthData

* fix for #1259 with PG

* Fix for Installations _PushStatus test

* Adds support for GlobalConfig

* Enables relations tests

* Exclude spec as legacy

* Makes corner case for 1 in GlobalConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants