Open JonatanSalas opened 3 months ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Hey @JonatanSalas. Can you fix the conflicts?
@exaby73 sure!
Description
When using firebase-functions v2
traceId
is missing for Firestore triggers likeonDocumentUpdated
.After a deep dive into the repository's code I've found that there's a difference.
onDocumentCreated
relies in the methodonOperation
which wraps the event handler with the functionwrapTraceContext
that injects thetrace
information.On the other side,
onDocumentUpdated
relies in the methodonChangedOperation
which executes the event handler without using thewrapTraceContext
function. I don't know if this is intentional, but this is a problem of those who are heavy users of firebase functions under the v2 because in previous version thetraceId
was available.I've adapted the code to make
onChangedOperation
use thewrapTraceContext
function. With that line I think we can solve the issue of missingtraceId
inonDocumentUpdated
.