Skip to content

Logic to catch multiple forbidden chars #32

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

Merged
merged 2 commits into from
Mar 2, 2021
Merged

Conversation

niallzato
Copy link
Contributor

Currently an evnet name like test-event-dashed-and.dotted will not be fully transformed to underscores which results in the event being rejected.

Using replace instead of the replaceAll for the whitespace check. Not sure if I am missing something form the original implementation for that.

}

Copy link
Contributor

Choose a reason for hiding this comment

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

i like this change :). Makes the code more concise. Does it do anything different compared to the old functionality? i cant seem to spot the difference

Copy link
Contributor

Choose a reason for hiding this comment

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

nvm found the diff. good spot on using replace instead of replaceAll. very subtle bug 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The replaceall confused me too. From what I understand, the main difference is supplying a regex pattern which does not seem necessary for the simple transformations we're doing.

@@ -169,6 +169,18 @@ public void makeKeyWithDot() {
verify(firebase).logEvent(eq("test_event"), bundleEq(new Bundle()));
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

🙌

Copy link
Contributor

@prayansh prayansh left a comment

Choose a reason for hiding this comment

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

LGTM

@niallzato niallzato merged commit c6c9f17 into master Mar 2, 2021
@prayansh prayansh mentioned this pull request Mar 23, 2021
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.

2 participants