In Firebase I have installed extension Resize Images
which claims to send an event upon completion: firebase.extensions.storage-resize-images.v1.complete
I have created a function trigger to handle this event:
exports.onimageresized2 = onCustomEventPublished(
{
eventType: 'firebase.extensions.storage-resize-images.v1.complete',
channel: 'projects/perfect-stroke-project/locations/europe-west4/channels/firebase',
region: 'europe-west4',
},
async (event: unknown) => {
const item = {
name: 'Hello',
};
const swingRequestDocRef = await firestore.collection('tool_types').add(item);
console.log(swingRequestDocRef.id);
console.log('it works!', JSON.stringify(event));
info([{ message: 'Received image resize completed event', event: event }]);
write({ message: 'received', severity: 'WARNING' });
},
);
To clarify regional settings
My firebase settings show: eur3 (europe-west)
My extension is set to: europe-west3
My extension is set to send Events to channel in europe-west4
I am expecting that the even will trigger the handling and thus a) show logs, b) create item in Firestore. However, neither of those happens. I try to use Logs Explorer
to search for any of the logs I have in my event handler, but none exist. In the meantime, I can confirm that extension is working and files get created, and I can see the logs for that extension.
How can I figure out what is wrong with the event and event handler?