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

Converting alert type and app id to camel case in the CloudEvent #1236

Merged
merged 2 commits into from Sep 20, 2022

Conversation

colerogers
Copy link
Contributor

@colerogers colerogers commented Sep 19, 2022

Fixes a bug where the SDK expected camel cased fields, but eventarc did not, so we convert them before passing the event to the end users code.

@colerogers colerogers changed the title Converting alert type and app id to camel case in the CloudEvent for alerts Converting alert type and app id to camel case in the CloudEvent Sep 19, 2022
@colerogers colerogers merged commit 65e66a2 into master Sep 20, 2022
@marcgovi
Copy link

Adding a note here that CloudEvent specs explicitly mention that extension context attributes (eg: appid and alerttype for Firebase Alerts) must be lowercase https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#extension-context-attributes.

I'm worried that the firebase functions is converting them to camel case format instead before delivering the CloudEvent object to the customer function.

@colerogers
Copy link
Contributor Author

@marcgovi We had a discussion offline, but posting here for visibility.

Basically, we try to match the TS/JS norms in the Functions SDK to give the best possible developer experience. In this case, converting fields to camelcase in the event signature. We have a history of changing the event with other integrations too, for example with RTDB, we convert fields to camelcase and also create a custom ref object so customers don't have to import the Admin SDK directly. We think these quality of life improvements make a difference to developers and should be included in the SDK

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.

None yet

3 participants