Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sygnal/gcmpushkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,13 @@ async def _dispatch_notification_unlimited(
body["priority"] = "normal" if n.prio == "low" else "high"

for retry_number in range(0, MAX_TRIES):
# Should only ever be one of `to` or `registration_ids` fields
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be clearer to rebuild the body at the top of this loop?

Any chance of being able to test this?

if len(pushkeys) == 1:
body["to"] = pushkeys[0]
body.pop("registration_ids", None)
else:
body["registration_ids"] = pushkeys
body.pop("to", None)

log.info("Sending (attempt %i) => %r", retry_number, pushkeys)

Expand Down