-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 fields does not work as expected #8027
Comments
Thanks for opening this issue!
|
I think the common interpretation is that LiveQuery should only trigger for the fields set, but this paragraph can be ambiguous, it's missing a clear description of the functionality. Does it more explicitly mention that LiveQuery only triggers for these fields when The parameter name is also not well chosen - "fields" does not imply any functionality. If we want to avoid making this a breaking change, we may use this opportunity to deprecate the |
The full paragraph is here https://github.com/parse-community/parse-server/wiki/Parse-LiveQuery-Protocol-Specification#subscribe-message I assume that the functionality of "if you are only interested in the change of the name field" is different to the existing functionality of |
Actually what do you think of:
|
I changed this from bug to feature, since the PR also seems to be a feature PR, if I got this right?
That's a clever suggestion; but if Maybe a clean approach to address the whole issue in a single PR:
|
You mean as method name instead of |
It looks like the |
@cbaker6 I'm thinking that too. Perhaps the spec was built before the feature was built, and it ended up behaving the same as |
I believe this comment also supports what you mentioned about fields: parse-community/Parse-SDK-JS#518 (comment) |
@mtrezza could you please update the spec: |
Sure, do you have a suggestion I can copy/paste? Interesting this is a GH wiki. Do we need to update anything in the docs as well? |
New Issue Checklist
Issue Description
According to the LiveQuery protocol, the fields parameter can be passed to only listen to updates on certain fields. However, this functions more like "select", where the payload only includes those keys, even if they haven't been updated.
Steps to reproduce
Create a subscription using the fields parameter, update any other key.
Actual Outcome
Live query is triggered
Expected Outcome
Live query should only trigger if the fields are updated (or new).
Here is an example of a failing test. No matter how many times an object save is called, the spy should only be called if the fields are selected.
Environment
Server
5.3
macos
local
Database
mongo
5.1
local
Client
JS
alpha
Logs
The text was updated successfully, but these errors were encountered: