push_notification: Remove 'content_truncated' field from FCM payload.

This commit removes the 'content_truncated' field from the FCM
payload to send push notification as it was unused by clients.
This commit is contained in:
Prakhar Pratyush
2025-08-04 11:32:31 +05:30
committed by Tim Abbott
parent c9edb9c9ce
commit dd134ef325
3 changed files with 3 additions and 6 deletions

View File

@@ -28,6 +28,8 @@ format used by the Zulip server that they are interacting with.
notifications no longer contain the legacy pre-2019
`zulip_message_id` field; all functional clients support the newer
`zulip_message_ids`.
* Mobile push notification payloads for FCM to for new messages no
longer contain the (unused) `content_truncated` boolean field.
**Feature level 412**

View File

@@ -1180,13 +1180,12 @@ def get_message_payload_gcm(
assert message.rendered_content is not None
with override_language(user_profile.default_language):
content, truncated = truncate_content(get_mobile_push_content(message.rendered_content))
content, unused = truncate_content(get_mobile_push_content(message.rendered_content))
data.update(
event="message",
zulip_message_id=message.id, # message_id is reserved for CCS
time=datetime_to_timestamp(message.date_sent),
content=content,
content_truncated=truncated,
sender_full_name=sender_name,
sender_avatar_url=sender_avatar_url,
)

View File

@@ -784,7 +784,6 @@ class PushBouncerNotificationTest(BouncerTestCase):
"zulip_message_id": message.id,
"time": datetime_to_timestamp(message.date_sent),
"content": message.content,
"content_truncated": False,
"server": settings.EXTERNAL_HOST,
"realm_id": hamlet.realm.id,
"realm_uri": hamlet.realm.url,
@@ -1816,7 +1815,6 @@ class TestGetGCMPayload(PushNotificationTestCase):
"zulip_message_id": message.id,
"time": datetime_to_timestamp(message.date_sent),
"content": content,
"content_truncated": truncate_content,
"server": settings.EXTERNAL_HOST,
"realm_id": hamlet.realm.id,
"realm_name": hamlet.realm.name,
@@ -1879,7 +1877,6 @@ class TestGetGCMPayload(PushNotificationTestCase):
"zulip_message_id": message.id,
"time": datetime_to_timestamp(message.date_sent),
"content": message.content,
"content_truncated": False,
"server": settings.EXTERNAL_HOST,
"realm_id": hamlet.realm.id,
"realm_name": hamlet.realm.name,
@@ -1927,7 +1924,6 @@ class TestGetGCMPayload(PushNotificationTestCase):
"zulip_message_id": message.id,
"time": datetime_to_timestamp(message.date_sent),
"content": message.content,
"content_truncated": False,
"server": settings.EXTERNAL_HOST,
"realm_id": hamlet.realm.id,
"realm_name": hamlet.realm.name,