react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

[πŸ›] πŸ”₯Support for inequality filters on multiple fields

Open thisisgit opened this issue 1 year ago β€’ 1 comments

Issue

Hi, starting April 2024, inequality filters on multiple fields is supported in 10.24.0 and it's been added to RNFB version 19.2.0 but looks like it's throwing error whenever this is performed.

Looks like this one's throwing error: 스크란샷 2024-06-18 α„‹α…©α„Œα…₯ᆫ 4 12 36

So when I tried commenting out that try catch, it returns the data without throwing any error. 스크란샷 2024-06-18 α„‹α…©α„Œα…₯ᆫ 4 14 11

However I couldn't figure out yet where that validateWhere function is declared and what it does. I assume it still validates for inequality filters on multiple fields and I believe that validation can be removed?


Project Files

Managed expo

Javascript

Click To Expand

package.json:

"@react-native-firebase/analytics": "20.0.0",
"@react-native-firebase/app": "20.0.0",
"@react-native-firebase/app-check": "20.0.0",
"@react-native-firebase/auth": "20.0.0",
"@react-native-firebase/crashlytics": "20.0.0",
"@react-native-firebase/firestore": "20.0.0",
"@react-native-firebase/functions": "20.0.0",

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • [x] I'm not using Pods
  • [ ] I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A

Android

Click To Expand

Have you converted to AndroidX?

  • [ ] my application is an AndroidX application?
  • [ ] I am using android/gradle.settings jetifier=true for Android compatibility?
  • [ ] I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->

Environment

Click To Expand

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • [ ] iOS
    • [ ] Android
    • [x] iOS but have not tested behavior on Android
    • [ ] Android but have not tested behavior on iOS
    • [ ] Both
  • react-native-firebase version you're using that has this issue:
    • 20.0.0
  • Firebase module(s) you're using that has the issue:
    • Firestore
  • Are you using TypeScript?
    • Y & 5.3.3

thisisgit avatar Jun 17 '24 16:06 thisisgit

I found where that validateWhere is located: https://github.com/invertase/react-native-firebase/blob/ca07cadd592487102b035a24b55f593f065ef4a5/packages/firestore/lib/FirestoreQueryModifiers.js#L237-L341

So what it does is to recursively call _filterCheck function, and the first for loop of the function is responsible for checking inequality filter for multiple fields. I believe that for loop can now be removed since it's now supported.

I wanted to open a PR for this but for some reason, it returns 403 whenever I try to push working branch to remote as described here.

thisisgit avatar Jun 19 '24 08:06 thisisgit