feat(flags): switch local evaluation endpoint to /flags/definitions#119
Open
patricio-posthog wants to merge 7 commits intomainfrom
Open
feat(flags): switch local evaluation endpoint to /flags/definitions#119patricio-posthog wants to merge 7 commits intomainfrom
patricio-posthog wants to merge 7 commits intomainfrom
Conversation
… avoid path collision
Match /flags/definitions for local eval and /flags/? for decide endpoint instead of ambiguous prefix matching on /flags/
…ching /flags/definitions
Rust returns 401 as a plain text body without a JSON 'detail' key, unlike Django which returned JSON. Check the HTTP status code first so auth failures are caught regardless of response format.
…n-200 error handling - Use exact path matching for decide endpoint (/flags/?) vs definitions (/flags/definitions) - Update ETag test to expect exception on 500 responses (loadFlags now throws on non-200)
dustinbyrne
reviewed
Apr 15, 2026
Comment on lines
+688
to
+690
| if ($responseCode !== 200) { | ||
| throw new Exception("Failed to load feature flags (HTTP $responseCode): " . $response->getResponse()); | ||
| } |
Contributor
There was a problem hiding this comment.
Can we error_log here instead? We typically try never to raise exceptions from within the SDK otherwise we risk introducing the risk of a panic into the consuming application unless properly handled.
I realize we're doing it right below this, but it's probably worth us addressing that separately.
Otherwise this change looks good!
Author
There was a problem hiding this comment.
Good catch, I'll do it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
The Rust feature flags definitions fleet now serves 100% of
/api/feature_flag/local_evaluationtraffic in all environments. This switches the SDK's default polling URL from the legacy Django path to the Rust endpoint's native path (/flags/definitions).The old
/api/feature_flag/local_evaluationpath remains registered as a route alias on the Rust service, so older SDK versions continue to work.How did you test it?
/flags/definitionsendpoint has been serving production traffic since 2026-04-09