-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Description
When using Flagsmith's Edge Proxy, the feature_state_value is returned as a string (e.g., "3000"). However, when directly using the Edge API endpoint (https://edge.api.flagsmith.com), the same feature_state_value is returned as a number (e.g., 3000). This inconsistency in data types can lead to bugs in client applications relying on the type of this value.
Steps to Reproduce
- Set up a Flagsmith feature flag with a feature_state_value of 3000 (or any numeric value).
- Retrieve the feature state via the Edge Proxy.
- Observe that feature_state_value is returned as a string (e.g., "3000").
- Retrieve the feature state via the Edge API Endpoint (https://edge.api.flagsmith.com).
- Observe that feature_state_value is returned as a number (e.g., 3000).
Expected Behavior
The feature_state_value should maintain a consistent data type (preferably a number for numeric values) across both Edge Proxy and Edge API Endpoint.
Observed Behavior
Edge Proxy: Returns feature_state_value as a string.
Edge API Endpoint: Returns feature_state_value as a number.
Impact
This inconsistency requires additional checks or parsing in client applications, which could otherwise rely on a consistent data type.
Environment
Flagsmith Environment: Production & Staging
Edge Proxy Docker Tag: 2.17
Suggested Fix
Standardize the feature_state_value data type (e.g., number for numeric values) across both Edge Proxy and Edge API Endpoint responses.
Additional Context
This behavior creates unnecessary complexity when integrating with Flagsmith in environments where both the Edge Proxy and Edge API Endpoint might be used interchangeably. We hit our edge proxy first, if that fails, we hit edge endpoint.
