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

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

Closed
eli-darkly opened this issue Mar 29, 2019 · 0 comments

Comments

@eli-darkly
Copy link
Contributor

We've identified some 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 Python SDK, like the other SDKs in weakly-typed languages, does not prevent this since the user object is simply a dictionary.

  1. LaunchDarkly will not process analytics events for such a user.
  2. If you set "secondary" to a non-string, and try to evaluate a flag that has a percentage rollout, the evaluation will fail.

We believe this behavior is the same in all existing versions of the Python 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.

LaunchDarklyCI pushed a commit that referenced this issue Oct 30, 2019
fix broken indirect/patch request, add tests for feature requestor
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

No branches or pull requests

1 participant