Skip to content

gcm: fix instance ID registration field - #3

Merged
Fizzadar merged 1 commit into
mainfrom
codex/gcm-instance-id-field
Sep 15, 2026
Merged

Fizzadar merged 1 commit into
mainfrom
codex/gcm-instance-id-field

Conversation

@iFixRobots

Copy link
Copy Markdown
Contributor

Problem

GCM registration sends the instance ID under a field Google does not use.

Fix

Use the lowercase appid field Chromium sends.

Notes

Verified token issuance with the existing UUID instance ID and corrected field. go build -mod=readonly ./... and go vet -mod=readonly ./... pass.

@indent

indent Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
PR Summary

Fixes GCM registration so the caller-supplied InstanceID is sent under the field name Google actually reads. RegisterGCM was setting the form key appId (camelCase), which the server ignores, so the InstanceID was effectively dropped from registration; it now sends lowercase appid, matching what Chromium sends.

  • gcm.go: change the registration form key from appId to appid for opts.InstanceID.

Verified against Chromium's instance_id_get_token_request_handler.cc, which declares kInstanceIDKey = "appid". This is the only usage of that key in the repo, and no in-repo consumer depends on the old name (the json:"appId" tag in fcm.go is unrelated response serialization).

Issues

No issues found.

CI Checks

All CI checks passed on 8037f51.

@Fizzadar
Fizzadar merged commit 621c7e4 into main Sep 15, 2026
5 checks passed
@Fizzadar
Fizzadar deleted the codex/gcm-instance-id-field branch September 15, 2026 14:32
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