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

32 vs. 64 bit issue on findObjectsInBackgroundWithBlock #1067

Closed
alexvenom opened this issue Nov 3, 2016 · 4 comments
Closed

32 vs. 64 bit issue on findObjectsInBackgroundWithBlock #1067

alexvenom opened this issue Nov 3, 2016 · 4 comments

Comments

@alexvenom
Copy link

alexvenom commented Nov 3, 2016

The following code works pretty well on 64bit devices (iPhone 5S, iPhone 6, iPhone 6S), but will return empty when running on a 32bit device (iPhone4, iPhone 4S, iPhone 5). Same iOS version on all devices. Repeatable in simulator and devices, also in iPads:

`- (IBAction)TestA:(id)sender {
PFQuery *myQuery = [PFQuery queryWithClassName:@"testClass"];

[myQuery whereKey:@"testKey" equalTo:[PFObject objectWithoutDataWithClassName:@"testClass" objectId:@"objectIDHere"]];

[myQuery findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
    NSLog(@"Result: %@", objects);
}];

} `

@przemyslaw-szurmak
Copy link

przemyslaw-szurmak commented Nov 21, 2016

Dear Parse,

I have exactly the same issue as above. The same query running on 64bit vs 32bit is not working. I even logged into server to check what differences are between queries.

query
let query = Thread.query() query?.whereKey(participantsKey, equalTo: user) query?.findObjectsInBackground(block: { (objects, error) -> Void in // some handler code })

32 bit request, of course SOME_HOST, SOME_IP and SOME_APP_ID are real and correct values in both cases
verbose: REQUEST for [GET] /parse/classes/Thread: { "where": { "threadParticipants": { "objectId": "FQbLTwPAD2", "className": "_User", "__type": "Pointer" } } } method=GET, url=/parse/classes/Thread, host=SOME_HOST, x-real-ip=SOME_IP, x-forwarded-for=SOME_IP, SOME_IP, content-length=113, accept=*/*, accept-encoding=gzip, deflate, accept-language=en-us, content-type=application/json; charset=utf-8, user-agent=Faver/17 CFNetwork/758.3.15 Darwin/16.1.0, x-parse-app-build-version=17, x-parse-app-display-version=0.1, x-parse-application-id=SOME_APP_ID, x-parse-client-version=i1.14.2, x-parse-installation-id=3f6d9f9c-368f-44b7-992d-21f563d9184b, x-parse-os-version=9.3 (16B2555), x-parse-session-token=r:beb1ba17a8e4a38461115d95311e0971, x-forwarded-port=443, x-forwarded-proto=https, objectId=FQbLTwPAD2, className=_User, __type=Pointer verbose: RESPONSE from [GET] /parse/classes/Thread: { "response": { "results": [] } } results=[]

64 bit request
verbose: REQUEST for [GET] /parse/classes/Thread: { "where": { "threadParticipants": { "__type": "Pointer", "className": "_User", "objectId": "FQbLTwPAD2" } } } method=GET, url=/parse/classes/Thread, host=SOME_HOST, x-real-ip=SOME_IP, x-forwarded-for=SOME_IP, SOME_IP, content-length=113, accept=*/*, accept-encoding=gzip, deflate, accept-language=en-us, content-type=application/json; charset=utf-8, user-agent=Faver/17 CFNetwork/808.1.4 Darwin/16.1.0, x-parse-app-build-version=17, x-parse-app-display-version=0.1, x-parse-application-id=SOME_APP_ID, x-parse-client-version=i1.14.2, x-parse-installation-id=ee70a870-c335-4ed4-b383-0788ed29e272, x-parse-os-version=10.1 (16B2555), x-parse-session-token=r:8f3b7824378f01617a86176cbeff3213, x-forwarded-port=443, x-forwarded-proto=https, __type=Pointer, className=_User, objectId=FQbLTwPAD2 verbose: RESPONSE from [GET] /parse/classes/Thread: { "response": { "results": [ { SOME_LONG_AND_PROPER_RESPONSE } ] }results=[SOME_LONG_AND_PROPER_RESPONSE]

(better formatted http://pastebin.com/KRvxMMeE)

Logs gathered from server running latest commit([email protected] (git://github.com/parseplatform/parse-server.git#c8823f296c6128b991f69fba4e602c8d004a4658)), requests made with iOS simulator 4s vs SE but it's 100% reproducible with real devices (checked on iPhone 5, 4s and 6s) as well as Parse-Server 2.2.2.
The only difference i can see is that order of fields __type, className and objectId is different. Is that issue ?

What's interesting only this query is failing, running same query but for non equal gives good results as well as other location based queries.
verbose: REQUEST for [GET] /parse/classes/Thread: { "where": { "threadParticipants": { "$ne": { "objectId": "FQbLTwPAD2", "className": "_User", "__type": "Pointer" } } } }
(this returns proper results)

What's more, I remember that for sure this was working fine on previous version of SDK which I was using, 1.13.x(don't remember last part).

Somewhere on the internet I've found some advices for ACL but for sure it's not the case here as all elements has read/write for everyone.

I think that's quite serious issue as still a lot of people has 32 bit devices.

@przemyslaw-szurmak
Copy link

Dear Parse, any update on it ? @nlutsenko forgive me for "calling" you personally but I think it's quite serious issue that recent SDK version is failing on so popular architecture ?

@przemyslaw-szurmak
Copy link

przemyslaw-szurmak commented Dec 3, 2016

I did further investigation on this issue and it seems that only what's different between SDK on 32 bit vs 64 bit is, indeed, order of parameters in request. And that hasn't change at least up to 1.13.0. So it seems it's more like server issue then SDK. Interesting thing is that this order matters only in case of doing query where value has to match value in pointers array.

Btw. I'm wondering what's the reason of different order of parameters for 32 bit SDK then 64 bit one ?

Update:
Answer is simple - query parameters are stored in NSDictionary which is unordered collection. However, if server treats requests a bit different in case described below in parse-community/parse-server#3169 shouldn't SDK use some ordered collection ?

@stale
Copy link

stale bot commented Sep 19, 2018

This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide

@stale stale bot added the wontfix label Sep 19, 2018
@stale stale bot closed this as completed Sep 26, 2018
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