I have a function I’ved deployed and scheduled to run every morning into my Google Cloud Functions. It says it runs successfuly and I even see some of the console logs I haven’t taken out yet, but when I look at my firestore collection the data isn’t updated. If I run this same function loca…
Tag: google-cloud-functions
How to do CRUD operations on a firestore DB from a cloud function? (Node.js)
I use a cloud function as a webhook receiver, so every time I get a webhook I want to update firestore with some data for example. I don’t get how to use firestore in my clound function. I tried this: All do not seem to be able to initilise this. I also tried: Answer As explained in the documentation, t…
Firebase functions using soap finishing with ECONNRESET “socket hang up”
I have a Firebase Function that was running for the last past two years that stopped working without any intervention on my part (no code change nor library update). It is used to retreive data from an external service with soap, parse the data and send it back to a client which is an Android app and now it t…
React native firebase handling payment flow
I am integrating payment api, I’m using firebase cloud functions as my backend and react-native in frontend, so right now i have the following code: In react-native side: firebase function to handle payment: So the question is, how can I handle long-time response/timeout error/network-loss etc in react-…
Firebase Cloud Storage – upload with metadata –
I wish to upload files from the browser with metadata that will allow the files to be identified and handled correctly with cloud functions. On the client my uploader code looks like this: And on the server (Firebase Cloud Functions using Node js) The uploadHandler is working – but metadata is undefined…
Realtime database cloud function sends result back before finishing
I’m trying to perform some realtime database tasks, which after completion, should send back a result back to the client so the client knows when the tasks have finished. I’ve tried to create a promise due to the fact some realtime database tasks do not return a promise – wasn’t sure w…
React / Stripe / createPortalLink() with firebase v9
I’m using Stripe extension for Firebase with firebase functions. Since I refactored a bit my code for firebase v9 modular SDK, I’m getting the following console error with my Stripe createPortalLink() function: Here is my function: Can anyone please advise? Thanks Answer You need to use the getFun…
Node js Engine not upgrading for firebase function node compatibility
First failed Here is the package.json Error: package.json in functions directory has an engines field which is unsupported. Valid choices are: {“node”: 10|12|14|16} Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI. Existing Node.js 8 functions will stop executing at a futu…
Using async/await inside firebase cloud functions
When performing asynchronous tasks inside a firebase cloud function do I need to await for every task like the example below: or can I just fire these asynchronous calls? given that I don’t need to return anything based on the data received from these tasks to the client like in the other example below:…
Firebase Functions Finished with status: error
I am writing my first Firebase Function that is supposed to make a collection with a document inside (in Firestore) when a new user registers. The only logs I am getting are the following: Function execution started and Function execution took 194 ms. Finished with status: error. The versions of the dependenc…