Skip to content

fix: add logic to convert traits to strings #763

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 3 commits into from
Feb 27, 2023
Merged

Conversation

ashton-huxtable
Copy link
Contributor

No description provided.

@alanjcharles alanjcharles merged commit 559a3bb into master Feb 27, 2023
@alanjcharles alanjcharles deleted the firebase-fix branch February 27, 2023 19:02
(acc: Record<string, string>, trait) => {
if (checkType(eventTraits[trait])) {
this.analytics?.logger.warn(
'We detected an object or array data type. Firebase does not accept nested traits.'
Copy link

@silesky silesky Feb 27, 2023

Choose a reason for hiding this comment

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

@alanjcharles checkType explicitly does not guard against arrays. Should this message be 'We detected a plain object data type'?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh yeah, nice catch!

}
if (event.traits) {
let eventTraits = event.traits;
let safeTraits: Record<string, string>;
Copy link

Choose a reason for hiding this comment

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

why make this a separate declaration? =)

oscb pushed a commit that referenced this pull request Feb 28, 2023
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.

4 participants