-
Notifications
You must be signed in to change notification settings - Fork 405
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
fix: Speed up identity overrides #4840
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
Docker builds report
|
Uffizzi Preview |
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.
Added a bunch of questions + not sure if the original issue is actually solved by this.
…h/flagsmith into fix/speed_up_identity_overrides
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4840 +/- ##
=======================================
Coverage 97.39% 97.39%
=======================================
Files 1191 1191
Lines 41552 41630 +78
=======================================
+ Hits 40470 40546 +76
- Misses 1082 1084 +2 ☔ View full report in Codecov by Sentry. |
affb7f3
to
6448a70
Compare
@@ -66,23 +74,66 @@ def get_identity_overrides_by_environment_id( | |||
self, | |||
environment_id: int, | |||
feature_id: int | None = None, | |||
) -> typing.List[dict[str, Any]]: | |||
feature_ids: None | list[int] = None, | |||
) -> list[dict[str, Any]] | list[IdentityOverridesQueryResponse]: |
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.
Since the PR has been approved this is a non-blocking comment but the polymorphic return type does look like a code smell.
At this point, factoring the feature_ids is not None
branch to a separate method looks like a good solution.
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.
Talked with @matthewelwell about it and we're going to leave that change to a subsequent PR.
…ithub.com:Flagsmith/flagsmith into fix/speed_up_identity_overrides
Changes
This changes the way that identity overrides are requested for the features page in two ways. First, instead of the entire document getting paginated and returned to the client, only one page per feature is returned. Second, instead of every feature being returned in the network call, we only serve up the features for the current page.
How did you test this code?
I've written one new test, although I'm awaiting codecov to let me know where else needs testing, since I'm sure some are missing.