Skip to content

LDEvaluationReason is null, if a flag is not linked to an experiment #383

@artyorsh

Description

@artyorsh

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @launchdarkly/js-sdk-common@2.2.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@launchdarkly/js-sdk-common/dist/api/data/LDEvaluationDetail.d.ts b/node_modules/@launchdarkly/js-sdk-common/dist/api/data/LDEvaluationDetail.d.ts
index c8d689d..fe994e6 100644
--- a/node_modules/@launchdarkly/js-sdk-common/dist/api/data/LDEvaluationDetail.d.ts
+++ b/node_modules/@launchdarkly/js-sdk-common/dist/api/data/LDEvaluationDetail.d.ts
@@ -37,7 +37,8 @@ export interface LDEvaluationDetailTyped<TFlag> {
     variationIndex?: number | null;
     /**
      * An object describing the main factor that influenced the flag evaluation value.
+     * This is null if the flag is not linked to a running experiment.
      */
-    reason: LDEvaluationReason;
+    reason?: LDEvaluationReason | null;
 }
 //# sourceMappingURL=LDEvaluationDetail.d.ts.map
\ No newline at end of file

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions