diff --git a/src/firebase_functions/__init__.py b/src/firebase_functions/__init__.py index 82cc49a..4d7df91 100644 --- a/src/firebase_functions/__init__.py +++ b/src/firebase_functions/__init__.py @@ -15,4 +15,4 @@ Firebase Functions for Python. """ -__version__ = "0.4.1" +__version__ = "0.4.2" diff --git a/src/firebase_functions/firestore_fn.py b/src/firebase_functions/firestore_fn.py index 8e5632d..a9d4f2a 100644 --- a/src/firebase_functions/firestore_fn.py +++ b/src/firebase_functions/firestore_fn.py @@ -169,13 +169,18 @@ def _firestore_endpoint_handler( firestore_event_data.old_value.create_time, firestore_event_data.old_value.update_time, ) - if event_type == _event_type_deleted: + + if event_type in (_event_type_deleted, + _event_type_deleted_with_auth_context): firestore_event_data = _typing.cast(_firestore.DocumentEventData, old_value_snapshot) - if event_type == _event_type_created: + if event_type in (_event_type_created, + _event_type_created_with_auth_context): firestore_event_data = _typing.cast(_firestore.DocumentEventData, value_snapshot) - if event_type in (_event_type_written, _event_type_updated): + if event_type in (_event_type_written, _event_type_updated, + _event_type_written_with_auth_context, + _event_type_updated_with_auth_context): firestore_event_data = _typing.cast( _firestore.DocumentEventData, Change( @@ -306,7 +311,7 @@ def on_document_written_with_auth_context_wrapped(raw: _ce.CloudEvent): _util.set_func_endpoint_attr( on_document_written_with_auth_context_wrapped, options._endpoint( - event_type=_event_type_written, + event_type=_event_type_written_with_auth_context, func_name=func.__name__, document_pattern=document_pattern, ),