mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
zilencer: Avoid creating duplicate remote push registrations.
Servers that had upgraded from a Zulip server version that did not yet support the user_uuid field to one that did could end up with some mobile devices having two push notifications registrations, one with a user_id and the other with a user_uuid. Fix this issue by sending both user_id and user_uuid, and clearing
This commit is contained in:
committed by
Tim Abbott
parent
d888bb3df2
commit
ade2225f08
@@ -547,6 +547,9 @@ def add_push_device_token(
|
||||
post_data = {
|
||||
"server_uuid": settings.ZULIP_ORG_ID,
|
||||
"user_uuid": str(user_profile.uuid),
|
||||
# user_id is sent so that the bouncer can delete any pre-existing registrations
|
||||
# for this user+device to avoid duplication upon adding the uuid registration.
|
||||
"user_id": str(user_profile.id),
|
||||
"token": token_str,
|
||||
"token_kind": kind,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user