-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: Identity overrides in local evaluation mode #142
Conversation
- Store environment-supplied identity overrides - Use stored identity overrides in local evaluation mode - Remove integration configurations from `EnvironmentModel`
if (identityOverrides != null) { | ||
Map<String, IdentityModel> identityOverridesByIdentifier = new HashMap<>(); | ||
for (IdentityModel identity : identityOverrides) { | ||
identityOverridesByIdentifier.put(identity.getIdentifier(), identity); | ||
} | ||
this.identityOverridesByIdentifier = identityOverridesByIdentifier; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment here to the one I added to the node.js repo here: Flagsmith/flagsmith-nodejs-client#143 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per discussion in Node.js client, let's update the name of this variable here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Contributes to Flagsmith/flagsmith#3132.
EnvironmentModel
IdentityModel.identity_features
type fromSet
toList
to fix equality checks for identities. It seems that using aHashSet
there initially was a mistake, as theFeatureStateModel
class did not havehashCode
implemented becauseequals
was overridden (at least, I didn't observe thehashCode
definition after delomboking in IDEA). Moreover, definingFeatureStateModel.hashCode
is tricky as its collections need different deduplication in different contexts.