-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
LiveQuery Support #45
Conversation
Codecov Report
@@ Coverage Diff @@
## main #45 +/- ##
==========================================
+ Coverage 76.53% 76.65% +0.12%
==========================================
Files 35 42 +7
Lines 3239 3757 +518
==========================================
+ Hits 2479 2880 +401
- Misses 760 877 +117
Continue to review full report at Codecov.
|
Conflicts: ParseSwift.playground/contents.xcplayground ParseSwift.xcodeproj/project.pbxproj
…cert pinning and auth. If no delegate, use default iOS
…tication challenge to parse calls
…od, 2) check parse auth provide by dev, 3) use default iOS
@TomWFox can you review the docs? This PR is moving into testing. |
@pmmlo Can you test this locally? I have a server setup via docker that will work out-of-the box with the Playgrounds files if you need it. It also gives you dashboard so you can add/remove/edit fields in there. Clone, and type The Playgrounds file with how to use LiveQuery is here: Parse-Swift/ParseSwift.playground/Pages/11 - LiveQuery.xcplaygroundpage/Contents.swift Lines 33 to 82 in c2c7e14
From what I've seen Subscribe and all of the Events seem to work fine. I broke something in unsubscribe and update, but it's probably an easy fix I'l get to later. |
@pranjalsatija can you review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only being picky really...
ParseSwift.playground/Pages/11 - LiveQuery.xcplaygroundpage/Contents.swift
Outdated
Show resolved
Hide resolved
ParseSwift.playground/Pages/11 - LiveQuery.xcplaygroundpage/Contents.swift
Outdated
Show resolved
Hide resolved
ParseSwift.playground/Pages/11 - LiveQuery.xcplaygroundpage/Contents.swift
Outdated
Show resolved
Hide resolved
ParseSwift.playground/Pages/11 - LiveQuery.xcplaygroundpage/Contents.swift
Outdated
Show resolved
Hide resolved
ParseSwift.playground/Pages/11 - LiveQuery.xcplaygroundpage/Contents.swift
Outdated
Show resolved
Hide resolved
Co-authored-by: Tom Fox <13188249+TomWFox@users.noreply.github.com>
Co-authored-by: Tom Fox <13188249+TomWFox@users.noreply.github.com>
Co-authored-by: Tom Fox <13188249+TomWFox@users.noreply.github.com>
@cbaker6 I had a little time to test this with a HTTPS server and
It seems like the Subscription is timing out or crashing. I have guesses on what may be going on but thought you may know immediately. Here's the code:
I never receive any events, despite editing in dashboard. I can unsubscribe with the expected response before the two errors fire. Any ideas? |
Did you register your liveQuery: {
classNames: ["GameScore", "Book", "Author"] // List of classes to support for query subscriptions
}, I tested this LiveQuery by leaving a subscriptions on over night in the simulator for an iPhone and Apple Watch and it didn't disconnect and sent events the next day. |
You can see how I setup the server for playgrounds here: https://github.com/netreconlab/parse-hipaa/blob/parse-swift/parse/index.js Also, for your server, are you behind a proxy? If you are using Nginx be sure to setup https://www.nginx.com/blog/websocket-nginx/ |
I have something similar with Express as well. I also ensured livequery server was initialized and the I guess not as straight forward as I thought it would be. I will dig into this then. Must be an implementation issue. |
I'm actually running it in a k8s cluster with an ingress. No Nginx proxy. |
But your http/localhost works when you use playgrounds and docker? |
Yup. The remote works as well, even graphql. |
I ran playgrounds using your docker and playgrounds. Worked well there. |
Maybe it's configuration, can you check if
is converting your url to |
This looks promising. I think it may be...let me try to test this. |
It's wss. Will need to checkout the ingress. Thanks! |
Are you able to connect using a site like https://www.websocket.org/echo.html |
There was an undocumented backend timeout of 30 seconds in AWS that seems to have been the issue. Would have guessed 30 seconds was enough... Just raised it to 5 minutes, which should be more than enough. No error, but I'm still not getting anything from .handleEvent(). I'll play around with this and post, if I figure out my issue. ;) |
Just started working after I put in breakpoints. Changed nothing, and I have an empty console. Maybe I should have cleaned the project first... Sorry! |
Minimum requirements to use LiveQuery are: macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0
Was able to reuse some of the ParseLiveQuery-iOS SDK.
This is a work in progress...
URLSessionWebSocket
hence the minimum requirements above... Uses a dedicated sessionURLSession.liveQuery
. Supports multiple connections to different serversURLSession.parse
which delegates authentication challenges also. LiveQuery will default to the parse authentication challenge if one isn't specified in the LiveQuery delegate.POST
instead ofGET
for user login