push notif: Explicitly set GCM priority `normal` for remove.

If we make a practice on the Zulip server of always explicitly setting
the desired priority, then when an old server doesn't set the priority
we can reasonably have the bouncer make a guess.
This commit is contained in:
Greg Price 2019-02-07 17:29:32 -08:00 committed by Tim Abbott
parent ffabebd7f3
commit a293aeee23
2 changed files with 3 additions and 3 deletions

View File

@ -591,7 +591,7 @@ def handle_remove_push_notification(user_profile_id: int, message_id: int) -> No
'event': 'remove', 'event': 'remove',
'zulip_message_id': message_id, # message_id is reserved for CCS 'zulip_message_id': message_id, # message_id is reserved for CCS
}) })
gcm_options = {} # type: Dict[str, Any] gcm_options = {'priority': 'normal'} # type: Dict[str, Any]
if uses_notification_bouncer(): if uses_notification_bouncer():
try: try:

View File

@ -710,7 +710,7 @@ class HandlePushNotificationTest(PushNotificationTest):
{'gcm': True, {'gcm': True,
'event': 'remove', 'event': 'remove',
'zulip_message_id': message.id}, 'zulip_message_id': message.id},
{}) {'priority': 'normal'})
@override_settings(SEND_REMOVE_PUSH_NOTIFICATIONS=True) @override_settings(SEND_REMOVE_PUSH_NOTIFICATIONS=True)
def test_non_bouncer_push_remove(self) -> None: def test_non_bouncer_push_remove(self) -> None:
@ -739,7 +739,7 @@ class HandlePushNotificationTest(PushNotificationTest):
{'gcm': True, {'gcm': True,
'event': 'remove', 'event': 'remove',
'zulip_message_id': message.id}, 'zulip_message_id': message.id},
{}) {'priority': 'normal'})
def test_user_message_does_not_exist(self) -> None: def test_user_message_does_not_exist(self) -> None:
"""This simulates a condition that should only be an error if the user is """This simulates a condition that should only be an error if the user is