Data Connect event listener ignored on emulator
Related issues
[REQUIRED] Version info
node: 20
firebase-functions: 7.0.0
firebase-tools:
14.26.0
firebase-admin:
13.6.0
[REQUIRED] Test case
Follow this guide: https://firebase.google.com/docs/functions/data-connect-events
Create a listener:
import { onMutationExecuted } from 'firebase-functions/dataconnect';
import { logger } from 'firebase-functions/v2';
export const someListener = onMutationExecuted(
{
region: 'europe-west1',
},
(event) => {
console.log(event.data);
logger.error(event.data);
}
);
Trigger any mutation using firebase data connect in the firebase console.
It should work when deployed - but doesn't work on emulator.
[REQUIRED] Steps to reproduce
Follow this guide: https://firebase.google.com/docs/functions/data-connect-events
[REQUIRED] Expected behavior
I expected the event listener to be triggered on mutation on emulator, but it only works on deployment. In fact, locally the emulator logs does not even list the listener here:
"functions Loaded functions definitions from source: ..."
[REQUIRED] Actual behavior
Nothing happens - the trigger isn't registered on emulator and therefore no logs are printed.
Were you able to successfully deploy your functions?
Yes, there it works fine.
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi! thanks for raising this, we will investigate and provide updates when available.
I realized after creating this, that it might just not be supported yet since it's a completely new feature.
A quick-fix could be to add to the documentation that emulator is not supported maybe? At least I expected it to when it wasn't mentioned and spend quite some hours trying to understand why it wouldn't trigger.
Obviously even better would be if it could be supported :D
In case it's true that this functionality is not supported, I have created a wish for it on user voice for others that come across this post: https://firebase.uservoice.com/forums/948424-general/suggestions/50742443-data-connect-event-triggers-on-emulator#comments Upvote and leave a comment if you'd like emulator to be supported
Hey, thanks! I'll raise this with the team to confirm.