launchdarkly / node-server-sdk

LaunchDarkly Server-side SDK for Node
Other
79 stars 65 forks source link

setting user attributes to non-strings when strings are expected can cause problems #147

Closed eli-darkly closed 5 years ago

eli-darkly commented 5 years ago

We've identified a potential problems that can happen if any of the non-custom user attributes that are expected to be strings (that is, all of them except anonymous) are instead set to a number or some other type. The Node SDK, like the other SDKs in weakly-typed languages, does not prevent this since the user object is simply a hash. The symptom is that LaunchDarkly will not process analytics events for such a user.

We believe this behavior is the same in all existing versions of the Node SDK.

Our planned fix is to make the SDK coerce these values to strings as needed. To avoid causing unexpected changes in behavior for existing code, we will not enforce strict typing in this major version.

eli-darkly commented 5 years ago

Fixed in 5.7.4.