Describe the bug
I created a feature flag, a metric, and an experiment which uses that feature flag and metric. I am not able to consistently log metrics to my experiment using client.track(...) when there is a time delay between evaluating the feature flag and tracking the metric.
To reproduce
The following code fails to populate the experiment with data.
import*asLaunchDarklyfrom'launchdarkly-node-server-sdk';constLD_KEY='...';constDELAY=30000;// 30 seconds(async()=>{constcontext: LaunchDarkly.LDContext={kind: 'user',key: `user-key-alex`,firstName: 'Alex',lastName: 'Miller',email: 'alexmiller@gmail.com',};constclient=LaunchDarkly.init(LD_KEY,{stream: false});awaitclient.waitForInitialization();awaitclient.variation('myFeature',context,false);// Pause between evaluating feature flag and tracking metricawaitnewPromise(resolve=>setTimeout(resolve,DELAY));client.track('myMetric',context,null,10);awaitclient.flush();client.close();})();However, if I change DELAY to DELAY = 10000 (10 seconds), then the experiment is populated with data.
Expected behavior
I would not expect a time delay between evaluating a feature flag and tracking a metric to have an impact on whether the data shows up in the experiment.
SDK version
launchdarkly-node-server-sdk@7.0.0
Language version, developer tools
Node v14.19.3
OS/platform
MacOS
Describe the bug
I created a feature flag, a metric, and an experiment which uses that feature flag and metric. I am not able to consistently log metrics to my experiment using
client.track(...)when there is a time delay between evaluating the feature flag and tracking the metric.To reproduce
The following code fails to populate the experiment with data.
However, if I change
DELAYtoDELAY = 10000(10 seconds), then the experiment is populated with data.Expected behavior
I would not expect a time delay between evaluating a feature flag and tracking a metric to have an impact on whether the data shows up in the experiment.
SDK version
launchdarkly-node-server-sdk@7.0.0Language version, developer tools
Node v14.19.3
OS/platform
MacOS