Skip to content

feat(flags): switch local evaluation endpoint to /flags/definitions#119

Merged
patricio-posthog merged 8 commits intomainfrom
feat/flags-definitions-endpoint
Apr 21, 2026
Merged

feat(flags): switch local evaluation endpoint to /flags/definitions#119
patricio-posthog merged 8 commits intomainfrom
feat/flags-definitions-endpoint

Conversation

@patricio-posthog
Copy link
Copy Markdown
Contributor

Motivation and Context

The Rust feature flags definitions fleet now serves 100% of /api/feature_flag/local_evaluation traffic 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_evaluation path remains registered as a route alias on the Rust service, so older SDK versions continue to work.

How did you test it?

  • Updated all test mock HTTP paths to match the new endpoint
  • The /flags/definitions endpoint has been serving production traffic since 2026-04-09

Comment thread lib/Client.php
Match /flags/definitions for local eval and /flags/? for decide endpoint
instead of ambiguous prefix matching on /flags/
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)
@patricio-posthog patricio-posthog force-pushed the feat/flags-definitions-endpoint branch from 1d51b81 to 107be18 Compare April 21, 2026 13:36
@patricio-posthog patricio-posthog merged commit 3770a2d into main Apr 21, 2026
16 checks passed
@patricio-posthog patricio-posthog deleted the feat/flags-definitions-endpoint branch April 21, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants