-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2 Firestore Triggers Type definitions define .data property on FirestoreEvents as possibly undefined #1464
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
I'm also interested in this? In what scenario would event.data be undefined? Background: event for onDocumentWritten is typed as: FirestoreEvent<Change<DocumentSnapshot> | undefined, ParamsOf<Document>> |
There may be some documentation missing here. I'll label it as such |
I'm also having issues accessing any information.
Nothing actually exists. I'm able to send event as a whole and it's just a bunch of numbers. If I try with the lines above it fails with: |
Hey @johnnyoshika @wneild - thanks for the question! After chatting with the team, I re-learned that the See #1370 for another description of the problem. Surprisingly, I wasn't able to find the discussion of this limitation in public GCP docs - I'll see if this limitation still exists in the platform and try to find related documentation on it. |
Ah the limitation is indirectly discussed here: https://cloud.google.com/functions/quotas#resource_limits Note that the behavior when the event is >10MB is "drop and log" - will ask if they plan on updating the doc to include that caveat. |
Based on @taeold's comment above, this is working as intended. I'll close this issue |
Related issues
[REQUIRED] Version info
node: 16.20.0
firebase-functions: 4.4.1
firebase-tools: 12.3.0
firebase-admin: 11.10.1
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
I expect every Firestore event to, at minimum, have data on what occurred and never be undefined.
[REQUIRED] Actual behavior
I am required to handle the possibility of undefined data on all Firestore events as per the following type defs:
Were you able to successfully deploy your functions?
Yes
The text was updated successfully, but these errors were encountered: