-
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
🔥 Error Using loadBundle() in Firestore: Unknown error or an error from a different error domain. #7798
Comments
I found a clue. I scrubbed through all the data in the source collection of one of the bundles that was causing the error, and found a bullet point character inside a text (String) field: I removed that character from the database, regenerated the bundle, and now that one works as expected. |
That's very strange - I don't believe we're doing anything special in particular at this layer, you might see if you can reproduce this using one of the firestore quickstarts for firebase-android-sdk or firebase-ios-sdk (if you can, then filing an issue in the respective repository/repositories and linking it back here would be awesome) |
@mikehardy, thanks for the response. I'm afraid those quickstarts are way outside my comfort zone. I'm a JavaScript coder, not Swift or Java, and I don't know my way around XCode or Android Studio at all. I let Expo/EAS do that nitty-gritty heavy lifting for me. If it's helpful for you, I can share the API endpoint of a bundle that is failing to load: |
The beauty of the quickstarts is that they are made for people who have zero comfort in the area - I'd strongly recommend giving them a try I won't have time to investigate specific bundles unfortunately - I think this really will be an underlying problem with the native SDKs or cloud firestore behind it's APIs, thus the guidance for a minimal reproduction based on the quickstart. It is also possible if you asked on stackoverflow with the correct sort of firebase / firestore tags and described the problem really well that someone from the firebase team upstream / related to the native SDKs we wrap here may be able to help |
OK, I cloned the quickstart for ios and (eventually) got it to run in a simulator. Can you please explain what it is that you want me to do with the quickstart that will help with finding the underlying problem in this issue? |
Check the reference docs for load bundle and basically copy paste their code but with your bundle name (can also use the react-native-firebase iOS code as an example). Whatever quick and dirty thing works to get your problematic bundle loaded using the native apis The only goal is to demonstrate the failure without react-native-firebase as an intermediate layer, that way the upstream team will accept it as an issue and fix underlying problem if it reproduces |
@mikehardy, that sounds like a decent plan. Unfortunately, I seem to have accidentally fixed the bundle. How did I do that? Well... The query that the bundle was based on includes/excludes documents based on a boolean field. In an attempt to figure out which document was causing the error in the client, I went through the documents in the collection one-by-one and flipped that boolean field so that they would be excluded from the query. My idea was that, once the bundle no longer threw an error when loading, I would have found the offending document, and then I could scrutinize that document to try to figure out what exactly about it was causing the issue. What happened was that I did indeed get to a point where the bundle no longer threw an error. When I found what seemed to be the offending document, I flipped the boolean field back again so that it would once again be included in the query. And the bundle still loaded without error, whether that document was included or not. Then, I flipped the field back on all the documents that I had changed, so that the set of documents was the same as when the error was first encountered. And the bundle loaded as expected, and I could no longer reproduce the error. I have no idea what changed in the bundle that allow it to load correctly now, even though the data contents are identical to when the error was occurring. Needless to say, this is confusing at best. But it unfortunately leaves me in a state in which I can no longer test this bug. It also leaves me in a state in which I don't feel confident that the bug won't reappear at some random point in the future. So my solution for the app that I am working on is to discontinue the use of bundles, and instead just provide JSON data via my REST API (which uses the same Cloud Functions/Cloud Hosting/CDN infrastructure, and the same caching advantages). So, I suppose that leaves this issue as not reproducible for the time being. I'm sorry about that. I suspect the problem will rear its head again for someone at some point. And perhaps that person will come across this issue and be able to add some helpful info from their own case. Meanwhile, thank you for your help. |
reluctantly closing since it seems there is something going on, but not actionable at the moment |
Issue
When calling
firestore().loadBundle(bundle)
in a React Native project, some bundles cause the following error to be thrown on iOS:[firestore/unknown] Unknown error or an error from a different error domain.
On Android, the same line of code throws a different error:
[firestore/invalid-argument] Client specified an invalid argument. Note that this differs from failed-precondition. invalid-argument indicates arguments that are problematic regardless of the state of the system (e.g., an invalid field name).
Other bundles work as expected.
When the error occurs, I have confirmed that the bundle text has been downloaded correctly from the endpoint. The call to
loadBundle()
fails with the error.Sample code:
I'm not sure why some bundles work as expected, and others don't. They are all created using the same code (NodeJS/Firebase Cloud Funtions):
I am just speculating here, but perhaps it is some sort of parsing error, maybe related to unexpected characters in the data?
I know there have been issues filed around this problem in the past (6224, for example), but those issues did not indicate any fixes or workarounds, and the problem remains.
Project Files
This is an Expo managed workflow project, with a custom Expo dev client, which uses plugins.
The project is built using the EAS build service, not on the local machine. So I don't have any Podfile or gradle files.
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:# N/A
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 info
output:react-native-firebase
version you're using that has this issue:18.7.3
Firebase
module(s) you're using that has the issue:firestore
TypeScript
?N
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: