Most firebase cloud function trigger function signatures include a context object which has an eventId property.
Looking at the documentation, this doesn't seem to be the case for HTTPS-triggers.
Is it safe to assume that calls to HTTP functions will only trigger once per request?
Jack's answer is mostly correct, but I'll clarify here.
The documentation on execution semantics is here. To be clear:
HTTP functions are invoked at most once. This is because of the synchronous nature of HTTP calls, and it means that any error on handling function invocation will be returned without retrying. The caller of an HTTP function is expected to handle the errors and retry if needed.
There is no guarantee that an HTTP function is executed exactly once. Some executions may fail before they reach the function. This is different from all other (background) types of function that provider at least once execution:
Background functions are invoked at least once. This is because of asynchronous nature of handling events, in which there is no caller that waits for the response and could retry on error. An emitted event invokes the function with potential retries on failure (if requested on function deployment) and sporadic duplicate invocations for other reasons (even if retries on failure were not requested).
So, for background functions to be 100% correct, they should be idempotent.
If you want to retry failed HTTP functions, the client will have to perform the retry, and in that case, you may want that HTTP function to be idempotent as well. The client will have to provide the unique key on retry, in that case.
Note that it's not possible to mark an HTTP function for internal retries. That's only possible for background functions.
HTTPS functions will only trigger once compared to background functions that have a at least once delivery guarantee.
(I cant find the docs where I read it. If I find it i will update the question)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With