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

Enable per-identity overrides in Local Evaluation mode #1762

Closed
dabeeeenster opened this issue Dec 12, 2022 · 3 comments
Closed

Enable per-identity overrides in Local Evaluation mode #1762

dabeeeenster opened this issue Dec 12, 2022 · 3 comments
Assignees
Labels
api Issue related to the REST API edge-api Related to edge.api.flagsmith.com feature New feature or request sdk Issues related to the SDKs

Comments

@dabeeeenster
Copy link
Contributor

dabeeeenster commented Dec 12, 2022

Overview

There is currently a functional deficiency in running the SDKs in Local Evaluation mode in that they ignore Identity overrides. This issue seeks to fix that deficiency. To do this, we plan to implement an (optional) limit to the number of Identity overrides per Environment.

Caveats that would be solved by Identity limiting

Allow for Identity overrides in Local Evaluation mode

When running the server side SDKs in Local Evaluation mode, we don't store any of the Identity overrides in the GET Environment Document endpoint as it could contain unlimited data. If we limited the number of Identity overrides, we could include that either in the main Environment document or as a supplementary endpoint. With these two pieces of data, local evaluation mode would include Identity Overrides.

Show identity overrides for an environment

When moving to Edge, we removed the option of seeing a list of Indentities that are overriding a particular Environment, as we have no index that can form this data. Limiting the number of overrides would allow us to store this data as a single large object of denormalised data. We could then reintroduce this view.

Technical Approach

If we limited the number of Identity overrides we could store the override data as a single piece, either in the main Environment document or as a supplementary endpoint. With these two pieces of data, local evaluation mode would include Identity Overrides.

Questions and Complications

  • Would the limit be based on the number of identity overrides or the total amount of data they consume?
  • What would the limit be?
  • DynamoDB has a max document size of 400kb.
  • What would we do with existing Edge overrides?
  • If we do this, the only easily accessible source of identity override data in Edge is the Dynamo Environment Document. Are we ok reading then writing to this?
@dabeeeenster dabeeeenster changed the title Limit number of Identity Overrides per Environment WIP: Limit number of Identity Overrides per Environment Dec 12, 2022
@dabeeeenster dabeeeenster changed the title WIP: Limit number of Identity Overrides per Environment Limit number of Identity Overrides per Environment Dec 12, 2022
@kyle-ssg
Copy link
Member

kyle-ssg commented Dec 15, 2022

From a frontend perspective, I think that the only requirement is to show an appropriate error when adding an override in the dashboard fails ? Potentially if we return this usage in /environments/:id I can display a warning too.

@kyle-ssg kyle-ssg removed their assignment Jan 3, 2023
@kyle-ssg
Copy link
Member

kyle-ssg commented Jan 3, 2023

Please assign back to me when we have a method to retrieving / detecting max identity overrides.

@dabeeeenster dabeeeenster added feature New feature or request api Issue related to the REST API edge-api Related to edge.api.flagsmith.com labels Jan 3, 2023
@dabeeeenster dabeeeenster changed the title Limit number of Identity Overrides per Environment Enable per-identity overrides in Local Evaluation mode Jan 31, 2023
@matthewelwell matthewelwell added the sdk Issues related to the SDKs label Apr 25, 2023
@matthewelwell
Copy link
Contributor

The only thing left here, is to support pagination, which only affects very large environments. I have created a separate issue to track the progress of this here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API edge-api Related to edge.api.flagsmith.com feature New feature or request sdk Issues related to the SDKs
Projects
Status: Done 2023
Development

No branches or pull requests

5 participants