Skip to content

Return errors from failed FCM registration - #2

Open
iFixRobots wants to merge 1 commit into
mainfrom
codex/push-registration-errors
Open

Return errors from failed FCM registration#2
iFixRobots wants to merge 1 commit into
mainfrom
codex/push-registration-errors

Conversation

@iFixRobots

Copy link
Copy Markdown

Google can return HTTP 200 with Error=PHONE_REGISTRATION_ERROR instead of a token. We currently treat that as a successful registration and return empty credentials.

Return an error when registration fails or no token is returned. Confirmed the provider-error path with a live request. Go build and vet pass.

@indent

indent Bot commented Sep 10, 2026

Copy link
Copy Markdown
PR Summary

Hardens RegisterGCM in gcm.go so failed FCM registrations return an error instead of silently returning empty credentials. Previously Google could reply with HTTP 200 and Error=PHONE_REGISTRATION_ERROR (or no token), which was treated as success; callers got empty credentials and no error.

  • Return an error when the register response contains an Error field.
  • Return an error when the HTTP status is not 200 (else if so a provider Error yields the more specific message first).
  • Return an error when the response contains no token.

Issues

No issues found.

CI Checks

All CI checks passed on 791ff10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants