Skip to content

gcm: use UUID subtypes for numeric senders - #4

Merged
iFixRobots merged 6 commits into
mainfrom
codex/gcm-numeric-sender
Sep 15, 2026
Merged

iFixRobots merged 6 commits into
mainfrom
codex/gcm-numeric-sender

Conversation

@iFixRobots

@iFixRobots iFixRobots commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Numeric FCM senders currently receive a wp: subtype, which returned HTTP 404 in the LinkedIn Local investigation. Use a plain UUID for those senders and keep the existing Web Push format. Preserve previously issued extension-format registrations, propagate registration errors, and use the incoming category when AppID is absent.

Google registration and cleanup passed for LinkedIn, Messenger, Google Voice and Viber. Real encrypted Messenger and incoming Voice messages reached the updated receiver with plain UUID registrations. Build, vet and CI pass. The full Beeper client delivery check is still in progress.

Related: beeper/hungryserv#588.

@indent

indent Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
PR Summary

Numeric FCM sender IDs (project numbers) were being registered as WebPush subscriptions (X-subtype=wp:<uuid>), which Google rejects. This PR registers numeric senders with a plain UUID subtype instead (dropping the wp: prefix), reads the push category as a fallback for MessageEvent.AppID when a push carries no subtype, and makes registration/unregistration surface failures explicitly instead of silently returning empty credentials. The change is scoped to three files; the WebPush path for non-numeric senders is unchanged from main. (An earlier revision of this PR also added a full Android application registration path with Firebase Installations; that has since been reverted.)

  • gcm.go: NewGCMAppID returns a plain UUID for numeric senders and wp:<UUID> otherwise; setGCMAppID sets app=org.chromium.linux + X-subtype=<appID> (with a leftover branch that would use app=<id> for a 32-char Chromium extension id); a new parseGCMResponse centralizes error handling (non-200 status, Error= body via the typed GCMError, and a missing register token), and unregister now confirms via a token or deleted == appID. The instance-id form field is also fixed from appId to lowercase appid.
  • events.go: newMessageEvent falls back to data.GetCategory() when the subtype-derived AppID is empty.
  • errors.go: adds the GCMError string type and the exported ErrGCMDeviceRegistration (PHONE_REGISTRATION_ERROR) constant.

Issues

No issues found.

CI Checks

All CI checks passed on 2a21d84.

@iFixRobots iFixRobots changed the title gcm: support numeric sender registrations fcm: support Android and numeric sender registrations Sep 12, 2026
@iFixRobots iFixRobots changed the title fcm: support Android and numeric sender registrations gcm: use UUID subtypes for numeric senders Sep 13, 2026
@iFixRobots
iFixRobots requested a review from tulir September 13, 2026 11:11
Comment thread gcm.go
appID = opts.AppID
} else {
appID = "wp:" + strings.ToUpper(uuid.New().String())
appID = NewGCMAppID(authorizationEntity)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume this is the only actually necessary change and it broke when the wp: prefix was added (web push started requiring the prefix in february)

The rest of the changes look reasonable too

@iFixRobots
iFixRobots merged commit fe885a8 into main Sep 15, 2026
5 checks passed
@iFixRobots
iFixRobots deleted the codex/gcm-numeric-sender branch September 15, 2026 12:58
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