launchdarkly / node-server-sdk

LaunchDarkly Server-side SDK for Node
Other
79 stars 65 forks source link

Fix TestData.ifMatch rule matching #259

Closed LiamMorrow closed 2 years ago

LiamMorrow commented 2 years ago

The rule was not matching, after debugging it was found that the expected rule operator field was named op not operator. This was found by debugging until getting to the matchFn function in evaluator.js.

There was also another issue where updating when using an ifMatch resulted in a JSON ref error. Replaced JSON based copy with manual copy. Requirements

Related issues https://github.com/launchdarkly/node-server-sdk/issues/258

Describe the solution you've provided This PR fixes the JSON circular ref by using a manual copy method in TestDataRuleBuilder rather than using JSON.stringify. It fixes the rules not matching by using op rather than operator when using TestDataRuleBuilder.andMatch

kinyoklion commented 2 years ago

Released in 6.4.3.

Thank you!