parse-community/ParseLiveQuery-Android

Constraints/Restrictions not working for LiveQuery

noaker opened this issue · 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

@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

Same for #85
is whereNotEqualTo is suppose to work?

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

Can you post logs VERBOSE=1?

Does live query works for you at all?

@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).