firebase / firebase/functions-samples

Revise email-users example to handle multiple function executions for a single user

Open
#105 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.2k
Forks
3.8k
Avg merge
3d 23h
Merged PRs (30d)
1

Description

I'm using the code from the sample here:
https://github.com/firebase/functions-samples/tree/master/quickstarts/email-users

onCreate is sometimes triggered multiple times for the same user. Most of the time it is triggered once, but sometimes it is triggered two times or even 7 times (which happened yesterday).
`exports.sendWelcomeEmail = functions.auth.user().onCreate(event => {`

No errors in the log, just the normal debug statements and the text output from `console.log('New welcome email sent to:', email);`

If I choose "View all from this execution", all 7 are shown, so they come from the same execution.

7 emails are also sent, so it's not just the debug output.

Only 1 account is created.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.