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

[expo-firebase-analytics] Updates Regex To Allow Numeric Chars #8516

Conversation

thorbenprimke
Copy link
Contributor

@thorbenprimke thorbenprimke commented May 27, 2020

Why

The eventName and userPropertyName for a firebase event support alphanumeric values but the regex was not allowing numeric characters.

How

Updates regex and adds additional check to ensure the first char is alphabetic.

Test Plan

Added unit tests with expected results. Saw them fail. Updated logic and now they pass.

@IjzerenHein
Copy link
Contributor

Thanks for this PR Thorben!

This seems like a duplicate of #8391, but this PR seems more complete. Although I think the regexp solution by @frantic is a little bit cleaner. Really appreciate the unit-tests here 🙏

@IjzerenHein IjzerenHein removed the request for review from EvanBacon May 28, 2020 11:45
- pulled out logic into isValidName
- added more tests
Copy link
Contributor

@IjzerenHein IjzerenHein left a comment

Choose a reason for hiding this comment

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

Looks great, many thanks for the unit-tests❤️

@thorbenprimke
Copy link
Contributor Author

@IjzerenHein - updated and added a user_id case to each of the tests.

@IjzerenHein IjzerenHein self-assigned this May 28, 2020
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