You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/proxy/client/features does not include segment information when requested by a client using one of the keys configured in EXP_SERVER_SIDE_SDK_CONFIG_TOKENS. This leads to unleash-client-node and unleash-client-go (and others I assume) to return invalid isEnabled() checks for features that have been assigned segments, when those clients connect to a proxy instead of an unleash-server instance.
Steps to reproduce the bug
In your Unleash instance, create a Segment constraint
Create a Feature and assign that Segment to it
Configure unleash-proxy with EXP_SERVER_SIDE_SDK_CONFIG_TOKENS
Configure an unleash-client-node instance to connect to the proxy URL instead of an unleash-server/api URL
Check the feature with context that should satisfy the segment constraint.
This will return false for the isEnabled() check.
Expected behavior
isEnabled() should return true when passing a context that satisfies the Segment constraint.
If you connect the unleash-client directly to the unleash-server instance (using a Client API Token), then it will return true as expected.
Logs, error output, etc.
I created a minimal reproduction of this issue here:
https://github.com/rossipedia/unleash-proxy-segment-bug
Screenshots
Additional context
I traced this down to the unleashApi method of the UnleashProxy class (here), which ultimately calls repository.getToggles(). Even if getTogglesWithSegmentData() were called, that method inlines the segment constraints into the feature definitions, rather than preserving the format of the initial /api/client/features response, which is what a consuming client expects.
Ideally, the response from /proxy/client/features when served from an unleash-proxy instance should be identical to the one that returns from /api/client/features when requested from an unleash-server instance.
I have verified the same broken behavior exists when using unleash-client-go, which gives the following debug output when connecting to unleash-proxy using EXP_SERVER_SIDE_SDK_CONFIG_TOKENS:
ERROR: segment does not exist
Note
unleash-edge does not exhibit this behavior. I believe updating unleash-proxy is still worthwhile though, as some consumers may not be able to easily migrate off of unleash-proxy.
Unleash version
Latest
Subscription type
Enterprise
Hosting type
Hosted by Unleash
SDK information (language and version)
unleash-proxy, latest version
The text was updated successfully, but these errors were encountered:
This repository is currently in maintenance mode and will not receive further development other than security patches going
forward. Unfortunately we will not continue development or fix experimental features here.
We've developed unleash-edge to be the successor to the unleash-proxy, so we recommend you use edge instead to handle your traffic.
Describe the bug
/proxy/client/features
does not include segment information when requested by a client using one of the keys configured inEXP_SERVER_SIDE_SDK_CONFIG_TOKENS
. This leads tounleash-client-node
andunleash-client-go
(and others I assume) to return invalidisEnabled()
checks for features that have been assigned segments, when those clients connect to a proxy instead of anunleash-server
instance.Steps to reproduce the bug
unleash-proxy
withEXP_SERVER_SIDE_SDK_CONFIG_TOKENS
unleash-client-node
instance to connect to the proxy URL instead of anunleash-server
/api
URLThis will return
false
for theisEnabled()
check.Expected behavior
isEnabled()
should returntrue
when passing a context that satisfies the Segment constraint.If you connect the
unleash-client
directly to theunleash-server
instance (using a Client API Token), then it will returntrue
as expected.Logs, error output, etc.
Screenshots
Additional context
I traced this down to the
unleashApi
method of theUnleashProxy
class (here), which ultimately callsrepository.getToggles()
. Even ifgetTogglesWithSegmentData()
were called, that method inlines the segment constraints into the feature definitions, rather than preserving the format of the initial/api/client/features
response, which is what a consuming client expects.Ideally, the response from
/proxy/client/features
when served from anunleash-proxy
instance should be identical to the one that returns from/api/client/features
when requested from anunleash-server
instance.I have verified the same broken behavior exists when using
unleash-client-go
, which gives the following debug output when connecting tounleash-proxy
usingEXP_SERVER_SIDE_SDK_CONFIG_TOKENS
:Note
unleash-edge
does not exhibit this behavior. I believe updatingunleash-proxy
is still worthwhile though, as some consumers may not be able to easily migrate off ofunleash-proxy
.Unleash version
Latest
Subscription type
Enterprise
Hosting type
Hosted by Unleash
SDK information (language and version)
unleash-proxy, latest version
The text was updated successfully, but these errors were encountered: