Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FCM second retry sends #331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Fizzadar
Copy link

When the first attempt succeeds for all but one pushkey the second attempt will end up populating both the to and registration_ids fields, which is rejected by FCM (400). For context, full errors looked like:

"[...] 400 from server, we have sent something invalid! Error: 'Must use either \"registration_ids\" field or \"to\", not both\\n'"

When the first attempt succeeds for all but one pushkey the second attempt
will end up populating both the `to` and `registration_ids` fields, which
is rejected by FCM (400).
@Fizzadar Fizzadar requested a review from a team as a code owner March 16, 2023 18:40
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

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

This needs lint & newsfragment also!

@@ -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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants