-
-
Notifications
You must be signed in to change notification settings - Fork 596
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
Allow to run queries through LiveQueryClient (Parse Server issue #9086) #2114
Comments
Thanks for opening this issue! |
@messagenius-admin I think the easiest solution would be to return the results of the query. This is an improved version of Alt 1.
Once a The This wouldn't require a server update. |
@dplewis, the goal is to sync an App with the Server also when the app is re-opened after being killed, shut down or restored from the background. In such cases, even if you re-subscribe to the LiveQuery, there may be a gap between the objects stored in your local storage, and the server. You need a Query to get all objects created or updated after the last time you opened the app, and you need to merge query results with your local copies. The focus of this issue/improvement is to enable querying Parse Server via the Websocket connection, rather than solely relying on REST API calls. The full scenario is described in the parent issue (parse-community/parse-server#9086). |
@messagenius-admin I see what you're saying, my solution would be more for offline apps, syncing the local storage after page load, re-open, shut down etc. In Alternative 1 if I call
|
@dplewis Yes, the goal is to avoid REST API calls when a WebSocket connection is in place. I have updated the Issue description to consider running all CRUD operations and Cloud Functions calls through Websocket. |
It should be possible to run Queries through a LiveQueryClient, and/or to request query results along with LiveQuery subscription to enable syncing collections and subscribing to LiveQueries with a single WebSocket connection.
A Parse Server issue with detailed information has been created here: parse-community/parse-server#9086. However, this feature requires development on both client and server.
Possible Alternative 1:
Get query results leveraging the subscription
Possible Alternative 2:
Allow running any query from a LiveQueryClient. This potentially enables developers to run queries through WebSocket, detached from a subscription.
Ideally, both alternatives 1 and 2 should be developed, with one serving as a shortcut for the other, similar to how currently a subscription can be run with or without an explicit liveQueryClient.
EDIT Apr 30:
Consider running all requests through WebSocket, including Queries, Saves, Cloud Functions, and all CRUD operations.
The text was updated successfully, but these errors were encountered: