Comments (5)
Hi @uhbsksingh - one way to help us help you would be to try debugging on the cloud functions emulator.
What to do:
- Ensure it throws exception on emulator
- Narrow down what is causing the bug by removing a couple of properties at a time (presumably you will have to match it on the emulator and redeploy).
- At some point, it will be successful and you will be able to narrow down what property is causing the exception. That way, we can figure out if the bug is a FlutterFire issue, firebase-ios-sdk or perhaps a misconfiguration.
Let me know how it goes 🙏
from flutterfire.
Hi @russellwheatley, the function works in the emulator. I sent the request using Postman to the emulator.
As for the properties, I sent the same JSON object I sent using Postman in callable.call
. I get an exception like this
flutter: error.code: unknown
flutter: error.details: {}
flutter: error.message: An error occurred
The JSON object sent in the following code is the same one I sent on the body of the request sent using Postman to the emulator. The request runs successfully in the emulator but the same JSON object is not working when I send from my Flutter app to the deployed function. This is my call from Flutter to the deployed function.
final response = await callable.call({
"data": {
"activeCollectionId": "cYcoK45wFyBradLyQbhU",
"action": {
"action": "Add allocated purchase",
"user": {
"appUserId": "Hj9OD16vUuQVM1rDh30iIdcKCfk2",
"fName": "Abhishek",
"lName": "Singh",
"imagePath": "mh_img_user/aa1692187748018"
},
"note": null
},
"purchaseBillList": [
{
"billID": "test-6102024-1",
"reference": 1,
"partner": {
"partnerId": "test",
"name": "test",
"imagePath": null
},
"info": {
"billDateTime":
"Timestamp(seconds=1718005730, nanoseconds=349154000)",
"dueDateTime":
"Timestamp(seconds=1718005730, nanoseconds=349154000)",
"dateTime":
"Timestamp(seconds=1718005730, nanoseconds=349154000)",
"currency": "NPR",
"action": {
"action": "Add allocated purchase",
"user": {
"appUserId": "Hj9OD16vUuQVM1rDh30iIdcKCfk2",
"fName": "Abhishek",
"lName": "Singh",
"imagePath": "mh_img_user/aa1692187748018"
},
"note": null
},
"paymentTerm": null,
"attachments": null,
"tags": null
},
"item": {
"itemId": "d2mFoM7U0VEVESSEosIu",
"name": "test",
"unit": {
"unitId": "pieces",
"abbreviation": "pcs",
"allowDecimal": false
},
"imagePaths": null
},
"quantity": 1.0,
"rate": 2200.0,
"tax": {}
}
],
"transferEntityDocumentID": "9INPot7vBE4qwtFbEhkY",
"appliedQuantity": 1.0,
"billItemImageMap": {"d2mFoM7U0VEVESSEosIu": null}
}
});
Is there any other way I can decode the error?
from flutterfire.
This is why I asked you to remove properties from the JSON object input (and removing use in emulated function) to see what is causing the exception. There might be an issue with properties being parsed. Might want to start with:
"billDateTime":
"Timestamp(seconds=1718005730, nanoseconds=349154000)",
"dueDateTime":
"Timestamp(seconds=1718005730, nanoseconds=349154000)",
"dateTime":
"Timestamp(seconds=1718005730, nanoseconds=349154000)",
Keep on removing properties until it works, then you will know which properties are causing the exception as they will be the ones you last removed.
from flutterfire.
I just noticed this in your cloud function:
} catch (exception) {
throw new HttpsError("unknown", "An error occurred", exception);
}
why don't you wrap this around the entirety of the cloud function code within the function? This is exactly the exception you're getting in your flutter code by the way.
from flutterfire.
Hey @uhbsksingh. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
from flutterfire.
Related Issues (20)
- [firebase_crashlytics]: flutter macOS does not terminate the app after stop debuging HOT 7
- Found some security issues HOT 3
- [firebase_auth] linkWithCredential() throws email-already-in-use exception in flutter app
- Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ) intialize issue HOT 1
- [firebase_auth] authStateChanges() stream fires when read/write into firestore HOT 4
- 🐛 [firebase_massaging] Example flutter ios build is too old
- firebase_code: Duplicate Classes HOT 6
- Firebase Phone MFA not working with some numbers HOT 1
- [📚] Old Doc doesn't have sum() and average() example for flutter. HOT 1
- [Firebase storage]: iOS only - Unable to establish connection to channel, happens in Workmanager or isolate only HOT 1
- [Firebase_auth]: <When I use signInWithEmailAndPassword without first using the createUserWithEmailAndPassword method, I get the error message [firebase_auth/channel-error] "dev.flutter.pigeon.firebase_auth_platform_interface.FirebaseAuthHostApi.signInWithEmailAndPassword".> HOT 11
- 🐛 [crashlytics][release] Information from recordFlutterFatalError shows up as 'Instance of 'DiagnosticsProperty<void>' HOT 1
- [firebase_app_check] App check token does not print on Android real devices HOT 9
- [firebase_auth]: [web] referencing FirebaseAuthException after running release version of app throws exception. HOT 2
- [firebase_messaging]: After turning off the device and turn back on, onBackgroundMessage is not fired on iOS. HOT 1
- [firebase_messaging]: After turning off the device and turn back on, onBackgroundMessage is not fired on iOS. HOT 4
- [firebase_core]: Cannot build app from version 3.0.0 HOT 4
- [FirebaseAuth]: Unhandled Exception: type 'List<Object?>' is not a subtype of type 'PigeonUserInfo' in type cast HOT 4
- [firebase_analytics]: `TypeError: Cannot convert undefined or null to object` when hot reload web application HOT 2
- [📚] README files in `example` directories have outdated docs and links
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutterfire.