Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

push_notification: Remove 'zulip_message_id' from FCM payload.

Prakhar Pratyushc9edb9c9ced9
diff --git a/api_docs/changelog.md b/api_docs/changelog.md
index 3d706554d20..0c9c7caf914 100644
--- a/api_docs/changelog.md
+++ b/api_docs/changelog.md
@@ -24,6 +24,10 @@ format used by the Zulip server that they are interacting with.
* Mobile push notification payloads for APNs no longer contain the
`server` and `realm_id` fields, which were unused.
+* Mobile push notification payloads for FCM to remove push
+ notifications no longer contain the legacy pre-2019
+ `zulip_message_id` field; all functional clients support the newer
+ `zulip_message_ids`.
**Feature level 412**
diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py
index 92ea7be5082..dea1474c168 100644
--- a/zerver/lib/push_notifications.py
+++ b/zerver/lib/push_notifications.py
@@ -1203,9 +1203,6 @@ def get_remove_payload_gcm(
gcm_payload.update(
event="remove",
zulip_message_ids=",".join(str(id) for id in message_ids),
- # Older clients (all clients older than 2019-02-13) look only at
- # `zulip_message_id` and ignore `zulip_message_ids`. Do our best.
- zulip_message_id=message_ids[0],
)
gcm_options = {"priority": "normal"}
return gcm_payload, gcm_options
diff --git a/zerver/tests/test_handle_push_notification.py b/zerver/tests/test_handle_push_notification.py
index 8463f732fad..598bf3d8e92 100644
--- a/zerver/tests/test_handle_push_notification.py
+++ b/zerver/tests/test_handle_push_notification.py
@@ -655,7 +655,6 @@ class HandlePushNotificationTest(PushNotificationTestCase):
"user_id": self.user_profile.id,
"event": "remove",
"zulip_message_ids": str(message.id),
- "zulip_message_id": message.id,
},
{"priority": "normal"},
list(
@@ -724,7 +723,6 @@ class HandlePushNotificationTest(PushNotificationTestCase):
"user_id": self.user_profile.id,
"event": "remove",
"zulip_message_ids": str(message.id),
- "zulip_message_id": message.id,
},
{"priority": "normal"},
)