open-feature / js-sdk-contrib

OpenFeature Providers and Hooks for JavaScript
https://openfeature.dev
Apache License 2.0
35 stars 35 forks source link

fix(flagd): improve targeting key check in fractional operator #1048

Closed beeme1mr closed 2 weeks ago

beeme1mr commented 2 weeks ago

This PR

Notes

The old logic was always truthy. This corrects the behavior and brings it in line with Java.

https://github.com/open-feature/java-sdk-contrib/blob/main/providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/targeting/Fractional.java#L43

How to test

Run the jest test suite. The test added this PR failed before the fix.