-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: getAggregateFromServer
does not consider any where
clauses attached to its query
#8253
Comments
where
clauses attached to its query
where
clauses attached to its querygetAggregateFromServer
does not consider any where
clauses attached to its query
Same problem here, can't use sum or average |
Hi @joaqo, thanks for the report. I've been able to reproduce this issue with the snippet you shared. This issue will be further investigated. |
@joaqo - looks like @SelaseKay has a fix queued up for this in #8259 ( 💪 !) - but I want to note that the fix is in the iOS native code only. I reviewed the original PR this bug spawned from and it appears to me that the android native code from the original PR was already applying the where (or any other filters) to the aggregate query correctly so I don't think it needed repair. But just to be sure: can you confirm that you saw the erroneous non-filtered behavior on iOS, but that it was working correctly already on android? |
With an e2e test probing this and showing it works on both platforms I'm going for the default answer "it's fine on android" and I've approved the PR, personally. Hopefully we can get this fix merged and released shortly |
Sorry, was away from computer for a few days. Can confirm that version Thank you so much for this 😊 PD: I know this is off-topic but version
I am not using the web sdk in any way shape or form. Regrettably this makes this version useless for me. I was on version |
Glad to hear it!
I do understand, but will ask for understanding in return:
Developers must (I emphasize must) migrate to the new modular-style APIs so I beg you instead to actually do the transition All of the packages will receive those deprecation notices shortly, we've only done a few packages so far. I will note that I originally feared it was going to be awful in my personal / work projects and ... it wasn't at all. The API transition is literally mechanical. Every single API has a corresponding API that behaves exactly the same, it was just import changes and re-arranging the call. In the end it was the work of an hour or two with no issues |
Oh! I completely misunderstood the warning message then. I thought it was some sort of weird dependency that you had on the official firebase web sdk that was misbehaving. What you're telling me is that you're purposely moving your own api to more closely match the official firebase web sdk's modular api? That actually sounds great! We are going to be adding a web version to our app, and we were dreading having to create an abstraction over RNFB and the web sdk so that our components can consume a single api and therefore maximize code share between web and mobile. It seems that this new api is going to make that much easier, or unnecessary even. I'll get moving towards the new api as soon as possible. 😄 Thanks again for your hard work! PD: This seems like quite a big change on your end, have you communicated this to your userbase? It took me completely off guard at least. Also the current warning messages is not so clear, it talks about v8 methods vs v9 methods while RNFB is currently on v21. Thats the reason I originally thought it was a firebase web sdk dependency bug instead of a RNFB api change. |
Believe it or not we already have excellent fidelity with firebase-js-sdk v8 and v9+ APIs, it's just that we've been around so long that everyone still just uses the old v8 APIs. We are supposed to be basically drop-in compatible. firebase-js-sdk is only just now actually getting rid of the v8 APIs though and we have to follow suit
Working on it - your feedback on the messaging is useful, I'll pass it along that the versioning reference is not great |
Awesome, thanks! |
Issue
As requested by @mikehardy I created this issue that originated from this comment on PR #8115.
While trying (unsuccessfully) to use the new
sum
aggregated query, I found out that thegetAggregateFromServer
function does not considerwhere
clauses attached to it, at least when used with collection groups. Here is a MRE.This issue is particularly worrisome as it completely disallows the usage of the new
sum
andaverage
functions, as they don't yet have support for method chaining thatcount
does, so using them throughgetAggregateFromServer
is the only way to use them!Using RNFB 21.7.1.
Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?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-firebase
version you're using that has this issue:21.7.1
Firebase
module(s) you're using that has the issue:firestore
TypeScript
?Yes ~5.3.3
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: