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 message nesting when retrying Firebase v1 notifications #387

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

devonh
Copy link
Contributor

@devonh devonh commented Jun 20, 2024

The final step of building the notification body for Firebase v1 was setting the message key inside of the retry loop.
This meant that on a retry, the message field would be recopied inside of itself leading to nested messages.

Since that is not a valid Firebase notification, it would lead to errors from Firebase like the following:

400 from server, we have sent something invalid! Error: 
'{
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \\"message\\" at \'message\': Cannot find field.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "message",
            "description": "Invalid JSON payload received. Unknown name \\"message\\" at \'message\': Cannot find field."
          }
        ]
      }
    ]
  }
}'

@devonh devonh requested a review from a team as a code owner June 20, 2024 23:42
@devonh devonh merged commit 5d9e2e2 into main Jun 21, 2024
5 checks passed
@devonh devonh deleted the devon/message-nesting branch June 21, 2024 14:28
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