This repository has been archived by the owner on May 30, 2024. It is now read-only.
Evaluate "interpreted" attributes when they are set as custom attributes. #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An interesting situation arose where if you don't set "interpreted" attributes via the special builder methods in
LDUser
they are not evaluated at all (e.g. when set via.custom()
). I found this a little counterintuitive because it was not immediately obvious - or explicit that this was the case via the documentation / javadoc.This change adds the ability to also evaluate them if a user sets an "interpreted" special attribute via custom. It implicitly also allows you to evaluate against a list of them like other custom attributes.
I am not sure if there was a deliberate reason for choosing to only make them evaluate if set via the dedicated methods. I noticed the same thing happens in other clients: https://github.com/launchdarkly/python-client/blob/master/ldclient/util.py#L69
If there is a good reason for not allowing this fallback - then I would suggest an update to documentation to more explicitly cover which fields are considered "interpreted" / "special" / "builtin" so it's less easy to fall into this situation.