You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ x ] I confirm this is a suspected bug or issue that will affect other users
I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
[ x ] I have read the documentation thoroughly and it does not help solve my issue.
[ x ] I have checked that no similar issues (open or closed) already exist.
Current behavior:
When creating a filter for a fetchFirestoreCollection request (on Android) and filtering using a number type (primitive number, not string encoded number), the query will always return 0 results because the code in FirebasePlugin.java which converts the filter array into an actual query object casts the value entry as a string primitive automatically.
I have not tested this functionality on iOS yet, nor am I well versed enough in Obj-C to tell if this issue will exist on iOS based solely on the code.
Expected behavior:
The query should maintain the primitive number type for the query.
Other information:
I'm not entirely certain how to resolve this issue cleanly. It doesn't appear that the JSONArray has a way to determine the primitive type (though the JSON syntax does denote this by omitting the quotes around primitive numbers).
The only way I can see around this would involve additions to the filter object to specify type, which could be a breaking change if not handled correctly.
The text was updated successfully, but these errors were encountered:
Value typing isn't something that was handled in the PR which added support for Firestore filters but I've added support for this in the above commit (currently on the dev branch).
It enables an optional valueType element to be specified in the relevant filter arrays which forces the native type to that which is specified.
Since the additional parameter is optional, this does not introduce a breaking change to the plugin API.
Bug report
CHECKLIST
[ x ] I have read the issue reporting guidelines
[ x ] I confirm this is a suspected bug or issue that will affect other users
Current behavior:
When creating a filter for a
fetchFirestoreCollection
request (on Android) and filtering using a number type (primitive number, not string encoded number), the query will always return0
results because the code inFirebasePlugin.java
which converts the filter array into an actual query object casts thevalue
entry as astring
primitive automatically.cordova-plugin-firebasex/src/android/FirebasePlugin.java
Lines 2162 to 2179 in 753e529
I have not tested this functionality on iOS yet, nor am I well versed enough in Obj-C to tell if this issue will exist on iOS based solely on the code.
Expected behavior:
The query should maintain the primitive number type for the query.
Steps to reproduce:
Environment information
9.0.0
Other information:
I'm not entirely certain how to resolve this issue cleanly. It doesn't appear that the
JSONArray
has a way to determine the primitive type (though the JSON syntax does denote this by omitting the quotes around primitive numbers).Reference: https://processing.org/reference/JSONArray.html
The only way I can see around this would involve additions to the filter object to specify type, which could be a breaking change if not handled correctly.
The text was updated successfully, but these errors were encountered: