ParseLiveQuery-Android icon indicating copy to clipboard operation
ParseLiveQuery-Android copied to clipboard

Constraints/Restrictions not working for LiveQuery

Open noaker opened this issue 6 years ago • 5 comments

Although it is mentioned in link below that the follow constraints work for LiveQuery, it doesn't.

  1. whereLessThan, whereGreaterThan, whereLessThanOrEqualTo, whereGreaterThanOrEqualTo parseQuery.whereLessThan("key", value);

  2. 2 equalTo constraints on 2 different keys query.whereEqualTo("keyA", parseObject1); query.whereEqualTo("keyB", parseObject2);

Link: https://github.com/parse-community/parse-server/wiki/Parse-LiveQuery-Protocol-Specification#subscribe-message

noaker avatar Dec 06 '18 14:12 noaker

@flovilmart are they supposed to work? Were they added to live query server? Do we need to do something in the live query client to support those constraints? Thanks

mmimeault avatar Dec 06 '18 15:12 mmimeault

Same for https://github.com/parse-community/ParseLiveQuery-Android/issues/85 is whereNotEqualTo is suppose to work?

mmimeault avatar Dec 06 '18 15:12 mmimeault

Quoted from the link

Right now we support $lt, $lte, $gt, $gte, $ne, $in, $nin, $exists, $all, $regex, $nearSphere, $within and normal equal condition. Any unsupported conditions will be ignored.

I am assuming lt = lessThan, lte = lessThanOrEqualTo, gt = greaterThan, etc.?

It would really be helpful if these were added. Also regarding whereNotEqualTo, it was answered that it's not part of the constraints supported so it will be ignored

noaker avatar Dec 06 '18 15:12 noaker

Can you post logs VERBOSE=1?

Does live query works for you at all?

dplewis avatar Dec 06 '18 15:12 dplewis

@dplewis there you go: (hope I am doing this right)

V/ParseLiveQueryClient: Socket onMessage {"op":"connected","clientId":"1cc04e96-4325-...omitted"} V/ParseLiveQueryClient: Connected, sending pending subscription V/ParseLiveQueryClient: Socket onMessage {"op":"subscribed","clientId":"1cc04e96-4325-...","requestId":1}

Some of the constraints work for me, such as a single "whereEqualTo(...);".

Also, it's pretty strange that while the LiveQuery does not consider some of the constraints specified, these constraints are applied to the "query" variable returned in the callback public void onEvent(ParseQuery<ParseObject> query, ParseObject object).

noaker avatar Dec 06 '18 16:12 noaker