parse-community / Parse-SDK-dotNET

Parse SDK for .NET, Xamarin, Unity.
http://parseplatform.org
Apache License 2.0
323 stars 260 forks source link

Querying Doesn't Work in Certain Conditions #301

Closed TheFanatr closed 5 years ago

TheFanatr commented 5 years ago

Ahhh...good old Parse giving us massive head aches. I managed to compile the library from my mac, but it has two problems:

  • Task completion callback is inconsistent as mentioned above
  • You can't stack query conditions on top of each other anymore. For example the following doesn't work:

query = ParseObject.GetQuery ("Songs").WhereEqualTo ("Genre", "Classic").WhereEqualTo ("Name", "Beethoven");

Only the last "WhereEqualTo" condition is met. Whereas in older version of Parse Unity both conditions were met. I'm not sure what is going on. Can anyone confirm this issue?

Originally posted by @fayezsalka in https://github.com/parse-community/Parse-SDK-dotNET/issues/294#issuecomment-445488726

Parse for Unity on iOS apparently cannot handle queries larger than 100, and query conditions are apparently sometimes ignored.

TheFanatr commented 5 years ago

Can confirm that chained "where clauses" will only be respected if they are the last in the chain, but cannot reproduce issue where querying for many objects fails (tested on randomly-generated 252-object dataset).

scode-cmd commented 5 years ago

Can confirm that chained "where clauses" will only be respected if they are the last in the chain, but cannot reproduce issue where querying for many objects fails (tested on randomly-generated 252-object dataset).

I don't remember the exact number queries started to fail intermittently on iOS (I don't think it's a hard number). Some of the queries that didn't work had 400 objects in them with each object having at least one string that is 600 characters or more in size. I'm afraid creating a testing environment from production code is time consuming and I'm currently short on time.

TheFanatr commented 5 years ago

I have a testing environment set up where I can create as many objects as needed, no need to create one; I will test for the issue within the described parameters. I have also implemented a fix for the chaining bug in my fork. I will likely merge it with master soon.

TheFanatr commented 5 years ago

I randomly generated 400 objects in one class, each with 3 fields containing 600 randomly-generated characters as a string, a randomly-generated integer, and a randomly-generated boolean value. I executed various queries on the class, some with results over 200, tried querying the whole thing, and imposed all sorts of arbitrary restrictions, but it worked successfully every time.

TheFanatr commented 5 years ago

Here is an example datapoint:

{
  "testField1": "$PU0&)0,YH'H%#X0/-I,1N:1I!G&,(I=710FE$J6G;3@T8'0.34H/H*07EA%<+!QXD1NM2E+=3?O<S61T8QRN\".I'!0Y=ET=;<B1'3<VG*+V*4M=00+%3($V6BGL\"EHR8\"5!2%+AUU+DQ2?L-LJ.:P*39EU?EJT\"<2>(YM,+%D*8V9&$$U?0U:8BR\"AG*EV,!))?M7M9@@)PGL7Y@Q;J+E'\"SV0X,?!:GX7M0@1F(&I52BU'EA(2+-!6#'EQ(N.\"?I)H5CJYANB%VKJ2!)4E8H/;W\"K)T9?3RGPB9-L\"Q(K6DV9174QX;BCP:HK3RA%(0/,/U)RM72M0WSQ!C:LAB@Q0$Y)K;9*1#C&5K+5/<$B*O3S@PJJ8N>?I7U+VY'2W)<.4M<08&>%?XH;J&BTKIL=>%7WOY8/5KD!4&?L5:220:!JH;:P8,A/7YI07>;9G0IN5H'E@O@17:-%$F/5@BP**5D4706PYSE!J,6!4O0BE1QVMD,J0&S&9@DY$M.1:J1>O,4Q1.\"J2.>S=GAL$EAS!?A+A6V@AY)UY4(A14:\"%)N,\"K=6-<-O*8>0E*0U1;*2&BS*@Y<J,?NRK6*PSA4%L",
  "testField2": 728114824,
  "testField3": true
}

Can you provide an specific examples of data or query restrictions that should be tested? What was the context of the failure; where there many queries executing simultaneously? Is there anything else that I should try? At the moment, I am failing to reproduce this issue.

TheFanatr commented 5 years ago

@fayezsalka I tried again, but this time with 500+ objects, with each one containing a string exactly 1000 characters in length, and a couple of other fields again. I have not seen any inconsistencies in querying performance or task completion, so I am going to assume that this was either due to how the Parse SDK interacts with the specific version of Parse server you are targeting, and/or something to do with your environment (such as a bug in the version of Unity and/or Mono you are using). If you can provide more information (such as Parse server version), that would be great, but otherwise, I am going to consider this issue closed because I've tested this many times even with the latest version of Parse server, and it works fine. I will add the fix for the query condition chaining bug that is present in the master branch.