I've been deployed HTTP and Storage triggered functions with no problems. When I deploy a firestore event (.onUpdate or .onWrite) function it never triggers. When I look at the console (detailed info) I see all my functions with the correct trigger type listed, except for the firestore functions which show 'unknown'.
firebase-tools: [email protected]
Below are two sample cloud functions. The first, 'fred' with 'firestore.document' shows up with trigger type: 'unknown'. The second 'makeUpperCase' is a test that triggers off the Realtime database (which I don't really use) but when it's loaded, it does show the correct trigger type in the console.
I'm not sure if I'm missing something really simple, or this is a firestore bug. (I did load a firestore trigger function that I had working a few months ago and it also didn't trigger properly, which leads me to suspect Firestore problem.)
export const fred = functions.firestore.document('users/{userId}').onWrite(event => {
console.error(`fred triggered: ${JSON.stringify(event.data.previous.data())}`);
return new Promise((resolve, reject) => {
resolve();
})
})
exports.makeUppercase = functions.database.ref('/organizations/{pushId}')
.onWrite(event => {
// Grab the current value of what was written to the Realtime Database.
console.log('Uppercasing');
return new Promise((resolve, reject) => {
resolve();
})
});