You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
After a lot of messing with my nginx configuration I figured out it had to do with my proxy setup.
There are a couple of issues about it over at SocketRocket123
I forkedParseLiveQuery and updated the SocketRocket dependency, which made the above error go away, but gave me another one.
Updating Parse and ParseLiveQuery to master seemed to have resolved this.
3) No errors ?
Sometimes errors only showed up when stepping through the code, this might have to do with the Obj-C >< Swift interop?
After a while, I got the error to show that I was missing a where clause on the query
4) Similarity to Parse-JS
The where clause on a query is not obligatory in Parse-JS
- The `sessionToken` is always sent (https://github.com/ParsePlatform/ParseLiveQuery-iOS-OSX/blob/3daca2f89a3869d026b1005dda57852012321836/Sources/ParseLiveQuery/Internal/Operation.swift#L21) from Parse-JS, this is only sent when logged in, this shouldn't matter though, just putting it out there.
### 5) Moar logging!
I started adding log statements to the ParseLiveQuery library, and saw that it was getting a connection, and sent subscriptions to the websocket connection (please add a flag for verbose logging!)
Because of the logs I noticed that I was querying an object that wasn't setup for live query (e.g. wasn't added to the liveQuery config for the parse server)
So I changed that and finally got responses back from the server
6) Callbacks don't fire
This is the real issue, I see the data is coming in when logging raw websocket data (or checking the Network traffic)
But the registered callback is not firing:
[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
configuration.applicationId = @"*****";
configuration.clientKey = @"*****";
configuration.server = @"https://devparse.*****";
configuration.localDatastoreEnabled = NO;
NSLog(@"Connecting to: %@", configuration.server);
}]];
self.client = [[PFLiveQueryClient alloc] initWithServer:@"https://devparse.*****"applicationId:@"*****"clientKey:@"*****"];
PFQuery *query = [PFQuery queryWithClassName:@"Messages"]; // <-- make sure you register the object in the parse-server config
[query whereKey:@"objectId"notEqualTo:@"whut"]; // <-- make sure you add a where clause
I cannot "step in" because I guess the handler does not want to respond to "didReceiveEvent" or something, or maybe the Event cannot be converted? in any case, something is hairy there
Related
#39
#36
#28
#36
#41
#7
I have been pulling my hair out for hours to debug this (dippin toes in Swift)
Here are my recollections of my memory of this trip down the rabbit hole for others:
1)
Could not build module Parse
Downloading
Parse
andParseLiveQuery
was ok, but whenever I build the project I get the error as in the title.It seems to go away (for 1 build, or not at all) when doing a (super) clean build, it seems I can ignore it, because the app builds fine.
2)
Invalid Sec-WebSocket-Accept response
Now I had a connection problem, the error I got was
After a lot of messing with my nginx configuration I figured out it had to do with my proxy setup.
There are a couple of issues about it over at
SocketRocket
1 2 3I forked
ParseLiveQuery
and updated theSocketRocket
dependency, which made the above error go away, but gave me another one.Updating
Parse
andParseLiveQuery
to master seemed to have resolved this.3) No errors ?
Sometimes errors only showed up when stepping through the code, this might have to do with the
Obj-C
><Swift
interop?After a while, I got the error to show that I was missing a where clause on the query
4) Similarity to Parse-JS
Parse-JS
- The `sessionToken` is always sent (https://github.com/ParsePlatform/ParseLiveQuery-iOS-OSX/blob/3daca2f89a3869d026b1005dda57852012321836/Sources/ParseLiveQuery/Internal/Operation.swift#L21) from Parse-JS, this is only sent when logged in, this shouldn't matter though, just putting it out there. ### 5) Moar logging!
I started adding log statements to the
ParseLiveQuery
library, and saw that it was getting a connection, and sent subscriptions to the websocket connection (please add a flag for verbose logging!)Because of the logs I noticed that I was querying an object that wasn't setup for live query (e.g. wasn't added to the
liveQuery
config for the parse server)So I changed that and finally got responses back from the server
6) Callbacks don't fire
This is the real issue, I see the data is coming in when logging raw websocket data (or checking the Network traffic)
But the registered callback is not firing:
Test 1:
Test 2:
At this moment, my versions of things are:
Parse
,ParseLiveQuery
,CocoaPods
-> master branchXCode
-> 7.3.17) Possible cause?
944065d
8) Working work around
I had seen enough off the code after this debug session to come up with the following, which seems to work:
Looking forward to the responses!
@richardjrossiii care to take a look at this?
The text was updated successfully, but these errors were encountered: