Skip to content

Conversation

djih
Copy link
Member

@djih djih commented Oct 4, 2016

We want to limit event properties / user properties in a single SDK call to 1000. The only time 1000 has ever been exceeded is when the customer accidentally sets too many, for example in like a loop.

return {};
}

if (Object.keys(properties).length > constants.MAX_PROPERTY_KEYS) {

Choose a reason for hiding this comment

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

Object.keys gives an objects own enumerable properties whereas for .. in loops over inherited enumerable properties as well. So there's an edge case where identify.set might still get called more than 1000 times.

Choose a reason for hiding this comment

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

I missed the hasOwnProperty check.

@djih djih merged commit 60c9129 into master Oct 7, 2016
@djih djih deleted the limit_property_keys branch October 7, 2016 19:01
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