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_notifs: Stop dropping ios_app_id on floor at bouncer.

Greg Price9c2d53bcef5b
diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py
index 9f6a5a22f6f..bb860811467 100644
--- a/zerver/tests/test_push_notifications.py
+++ b/zerver/tests/test_push_notifications.py
@@ -838,7 +838,8 @@ class PushBouncerNotificationTest(BouncerTestCase):
)
)
self.assert_length(tokens, 1)
- self.assertEqual(tokens[0].token, token)
+ self.assertEqual(tokens[0].kind, kind)
+ self.assertEqual(tokens[0].ios_app_id, appid.get("appid"))
# User should have tokens for both devices now.
tokens = list(RemotePushDeviceToken.objects.filter(user_uuid=user.uuid, server=server))
diff --git a/zilencer/views.py b/zilencer/views.py
index 0fac09d712b..971b48c85cd 100644
--- a/zilencer/views.py
+++ b/zilencer/views.py
@@ -162,7 +162,7 @@ def register_remote_push_device(
user_uuid: Optional[str] = REQ(default=None),
token: str = REQ(),
token_kind: int = REQ(json_validator=check_int),
- ios_app_id: Optional[str] = None,
+ ios_app_id: Optional[str] = REQ(default=None),
) -> HttpResponse:
validate_bouncer_token_request(token, token_kind)