-
-
Notifications
You must be signed in to change notification settings - Fork 597
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
Add installationId to LiveQuery #977
Conversation
Codecov Report
@@ Coverage Diff @@
## master #977 +/- ##
==========================================
+ Coverage 91.84% 91.85% +0.01%
==========================================
Files 54 54
Lines 5075 5083 +8
Branches 1142 1145 +3
==========================================
+ Hits 4661 4669 +8
Misses 414 414
Continue to review full report at Codecov.
|
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.
looks good, I had one comment that I think you should do...
src/ParseLiveQuery.js
Outdated
@@ -88,6 +88,7 @@ const DefaultLiveQueryController = { | |||
} | |||
const currentUser = await CoreManager.getUserController().currentUserAsync(); | |||
const sessionToken = currentUser ? currentUser.getSessionToken() : undefined; | |||
const installationId = await CoreManager.getInstallationController().currentInstallationId(); |
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.
you should do this async and the current user async together:
const [currentUser, installationId] = await Promise.all([...]);
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.
Done. I keep forgetting about that trick.
Adds reconnect for error event from server (already reconnects with web socket error).
Adds backwards compatibility for additionalProperties that do not exist in the server.
This PR will require a server update.
Use Case: Determine which client the live query request was sent from.
Will open a PR separately for the following.