Skip to content

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Jan 19, 2024

Contributes to Flagsmith/flagsmith#3132.

  • Store environment-supplied identity overrides
  • Use stored identity overrides in local evaluation mode
  • Remove integration configurations from EnvironmentModel
  • Change IdentityModel.identity_features type from Set to List to fix equality checks for identities. It seems that using a HashSet there initially was a mistake, as the FeatureStateModel class did not have hashCode implemented because equals was overridden (at least, I didn't observe the hashCode definition after delomboking in IDEA). Moreover, defining FeatureStateModel.hashCode is tricky as its collections need different deduplication in different contexts.
- Store environment-supplied identity overrides - Use stored identity overrides in local evaluation mode - Remove integration configurations from `EnvironmentModel`
@khvn26 khvn26 requested review from a team and novakzaballa and removed request for a team January 22, 2024 13:29
Comment on lines 63 to 69
if (identityOverrides != null) {
Map<String, IdentityModel> identityOverridesByIdentifier = new HashMap<>();
for (IdentityModel identity : identityOverrides) {
identityOverridesByIdentifier.put(identity.getIdentifier(), identity);
}
this.identityOverridesByIdentifier = identityOverridesByIdentifier;
}
Copy link
Contributor

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)

Copy link
Member Author

Choose a reason for hiding this comment

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

See response.

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@khvn26 khvn26 requested a review from matthewelwell January 30, 2024 14:19
@khvn26 khvn26 merged commit db55ef5 into main Mar 12, 2024
@khvn26 khvn26 deleted the feat/local-eval-identity-overrides branch March 12, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants