Describe the bug
When using ifMatch on TestData, there is a circular JSON reference error when calling the update method
To reproduce
const launchDarklyClient = ld.init('not a real key', { updateProcessor: testData, sendEvents: false })
const variationForMatch = testData.flag(featureFlagKey).ifMatch('someCustomKey', 'someKeyValue').thenReturn(false)
testData.update(variationForMatch)
Expected behavior
No error
Logs
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Array'
| index 0 -> object with constructor 'TestDataRuleBuilder'
| property '_flagBuilder' -> object with constructor 'TestDataFlagBuilder'
--- property '_rules' closes the circle
at JSON.stringify (<anonymous>)
at TestDataFlagBuilder.Object.<anonymous>.TestDataFlagBuilder.copy (../node_modules/launchdarkly-node-server-sdk/test_data.js:101:53)
at Function.TestData.td.update (../node_modules/launchdarkly-node-server-sdk/test_data.js:58:58)
SDK version
6.4.2
Language version, developer tools
Typescript/node/jest
OS/platform
All dev platforms
Additional context
Seems to be a circular ref between the rules and the data rule builder
Is this a support request? No
Describe the bug When using ifMatch on TestData, there is a circular JSON reference error when calling the update method
To reproduce
Expected behavior No error
Logs
SDK version 6.4.2
Language version, developer tools Typescript/node/jest
OS/platform All dev platforms
Additional context Seems to be a circular ref between the rules and the data rule builder