mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
push_notification: Drop notif if ANDROID_FCM_CREDENTIALS_PATH is unset.
If `ANDROID_FCM_CREDENTIALS_PATH` is unset it results in fcm_app=None. We should log error in this case and return, not doing so will result in runtime error. Signed-off-by: Prakhar Pratyush <prakhar@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
06501ab208
commit
d893496de1
@@ -88,6 +88,13 @@ def send_e2ee_push_notification_android(
|
||||
successfully_sent_count = 0
|
||||
delete_device_ids: list[int] = []
|
||||
|
||||
if fcm_app is None:
|
||||
logger.error("FCM: Dropping push notifications since ANDROID_FCM_CREDENTIALS_PATH is unset")
|
||||
return SentPushNotificationResult(
|
||||
successfully_sent_count=successfully_sent_count,
|
||||
delete_device_ids=delete_device_ids,
|
||||
)
|
||||
|
||||
try:
|
||||
batch_response = firebase_messaging.send_each(fcm_requests, app=fcm_app)
|
||||
except firebase_exceptions.FirebaseError:
|
||||
|
||||
Reference in New Issue
Block a user