Skip to content

fix topic subscription when @ and + are encoded - #8553

Open
tshedor wants to merge 1 commit into
firebase:mainfrom
tshedor:main
Open

fix topic subscription when @ and + are encoded#8553
tshedor wants to merge 1 commit into
firebase:mainfrom
tshedor:main

Conversation

@tshedor

@tshedor tshedor commented Aug 21, 2026

Copy link
Copy Markdown

FirebaseMessaging.subscribeToTopic() / unsubscribeFromTopic() produced a 400 on any topic containing %, even though the documented grammar is [a-zA-Z0-9-_.~%]{1,900}.

Introduced in firebase-messaging 25.1.0 (BoM 34.15.0, 16 Jun 2026) when FID registration landed (#8087) and TopicSubscriptionClient started concatenating the topic unescaped into https://fcmregistrations.googleapis.com/v1/projects/{id}/registrations/{fid}/topicSubscriptions/{topic}:{op}.

The server percent-decodes the path before validating, so fields like %2B or %40 become + / @ and the request is rejected.

This is still present in 25.1.1 / 25.1.2. Pre-25.1.0 (GmsRpc, last good BoM 34.14.0 / messaging 25.0.2) sent the topic as a gcm.topic value, so % survived.

This PR percent-escapes the topic path segment (%%25) on both subscribe and unsubscribe so the wire form matches the documented name. Same class of bug as firebase/quickstart-ios#242, fixed by firebase-ios-sdk#220.

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

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.

1 participant