push_notification: Remove "time" field from APNs payload.

This reverts 1862c3d9ab.

The "time" field was added in the APNs payload to log
"Remote queuing latency".

The client doesn't use this field. Ideally, we should have
removed the field from the payload before sending it to APNs.

We no longer log "Remote queuing latency", so it's safe to
remove it from the APNs payload.

Only FCM payload will have this field as it is used by android
clients.
This commit is contained in:
Prakhar Pratyush
2025-07-30 20:53:42 +05:30
committed by Tim Abbott
parent 2225142554
commit 6c625a0177
2 changed files with 1 additions and 9 deletions

View File

@@ -1000,7 +1000,6 @@ def get_message_payload(
else:
data["sender_email"] = message.sender.email
data["time"] = datetime_to_timestamp(message.date_sent)
if mentioned_user_group_id is not None:
assert mentioned_user_group_name is not None
data["mentioned_user_group_id"] = mentioned_user_group_id
@@ -1176,6 +1175,7 @@ def get_message_payload_gcm(
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,

View File

@@ -1474,7 +1474,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
"time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1517,7 +1516,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
"time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1562,7 +1560,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
"time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1604,7 +1601,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": self.sender.id,
"time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1649,7 +1645,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
"time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1690,7 +1685,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"user_id": user_profile.id,
"mentioned_user_group_id": user_group.id,
"mentioned_user_group_name": user_group.name,
"time": datetime_to_timestamp(message.date_sent),
}
},
}
@@ -1728,7 +1722,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": self.sender.realm.url,
"realm_url": self.sender.realm.url,
"user_id": user_profile.id,
"time": datetime_to_timestamp(message.date_sent),
},
},
}
@@ -1799,7 +1792,6 @@ class TestGetAPNsPayload(PushNotificationTestCase):
"realm_uri": hamlet.realm.url,
"realm_url": hamlet.realm.url,
"user_id": polonius.id,
"time": datetime_to_timestamp(message.date_sent),
}
},
}