mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
push_notifications: Adjust APNs tokens to be case-insensitive in the database.
APNs apparently treats its tokens case-insensitively; FCM does not. Adjust the `unique_together` to instead be separate partial constraints, keyed on the `kind` of the PushDeviceToken.
This commit is contained in:
committed by
Tim Abbott
parent
63f6a97f0c
commit
2f4dd72076
@@ -2757,7 +2757,7 @@ class PushNotificationTestCase(BouncerTestCase):
|
||||
apns_context.loop.close()
|
||||
|
||||
def setup_apns_tokens(self) -> None:
|
||||
self.tokens = [("aaaa", "org.zulip.Zulip"), ("bbbb", "com.zulip.flutter")]
|
||||
self.tokens = [("aAAa", "org.zulip.Zulip"), ("bBBb", "com.zulip.flutter")]
|
||||
for token, appid in self.tokens:
|
||||
PushDeviceToken.objects.create(
|
||||
kind=PushDeviceToken.APNS,
|
||||
@@ -2767,8 +2767,8 @@ class PushNotificationTestCase(BouncerTestCase):
|
||||
)
|
||||
|
||||
self.remote_tokens = [
|
||||
("cccc", "dddd", "org.zulip.Zulip"),
|
||||
("eeee", "ffff", "com.zulip.flutter"),
|
||||
("cCCc", "dDDd", "org.zulip.Zulip"),
|
||||
("eEEe", "fFFf", "com.zulip.flutter"),
|
||||
]
|
||||
for id_token, uuid_token, appid in self.remote_tokens:
|
||||
# We want to set up both types of RemotePushDeviceToken here:
|
||||
|
||||
Reference in New Issue
Block a user