-
Notifications
You must be signed in to change notification settings - Fork 7
feat(feature-flags): support quota limiting for feature flags #403 #56
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
Conversation
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.
PR Summary
This PR adds support for handling quota limits in PostHog's .NET SDK, responding to changes in the /decide and /local_evaluation APIs when users exceed their quota limits.
- Added
QuotaLimited
property toDecideApiResult
in/src/PostHog/Api/DecideApiResult.cs
to track which features are quota-limited - Implemented quota limit handling in
/src/PostHog/PostHogClient.cs
to return empty dictionaries for bulk flag requests when limits are hit - Added quota limit checks in
DecideAsync()
method to handle feature flag quota limitations - Added debug logging for quota exceeded scenarios with appropriate messages
- Added comprehensive test coverage in
/tests/UnitTests/Features/FeatureFlagsTests.cs
for quota limit scenarios
3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
Thanks @dmarticus! I'll fix this up. |
@haacked thanks! I was working on it locally but my .NET LSP isn't playing nicely so it's been a pain. Thanks for helping, lmk if you have questions about the implementation! |
When attempting a local evaluation API call that is quota limited, I assume we don't want to fallback to |
@dmarticus I also noticed the log level for quota exceeded is |
Yup, we should short-circuit if we get a local eval call that's quota limited |
Yeah, let's go with a warning log, that's what the other PRs do. |
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.
Nice work!
with PostHog/posthog#28564, we now start to respond different with the /decide and /local_evaluation APIs if users have gone over their quota limit. Now we need to change the SDKs to handle these new responses.