Skip to content

Commit a0467fa

Browse files
committed
remove attribute merge
Signed-off-by: Michael Samper <[email protected]>
1 parent 4c48c07 commit a0467fa

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

libs/providers/growthbook/src/lib/growthbook-provider.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ export class GrowthbookProvider implements Provider {
6565
context: EvaluationContext,
6666
): Promise<ResolutionDetails<boolean>> {
6767
if (!isEmpty(context)) {
68-
// Add flag evaluation context and merge with existing context
69-
await this.client.setAttributes({ ...this.client.getAttributes(), ...context });
68+
await this.client.setAttributes(context);
7069
}
7170

7271
const res = this.client.evalFeature(flagKey);
@@ -80,8 +79,7 @@ export class GrowthbookProvider implements Provider {
8079
context: EvaluationContext,
8180
): Promise<ResolutionDetails<string>> {
8281
if (!isEmpty(context)) {
83-
// Add flag evaluation context and merge with existing context
84-
await this.client.setAttributes({ ...this.client.getAttributes(), ...context });
82+
await this.client.setAttributes(context);
8583
}
8684

8785
const res = this.client.evalFeature(flagKey);
@@ -95,8 +93,7 @@ export class GrowthbookProvider implements Provider {
9593
context: EvaluationContext,
9694
): Promise<ResolutionDetails<number>> {
9795
if (!isEmpty(context)) {
98-
// Add flag evaluation context and merge with existing context
99-
await this.client.setAttributes({ ...this.client.getAttributes(), ...context });
96+
await this.client.setAttributes(context);
10097
}
10198

10299
const res = this.client.evalFeature(flagKey);
@@ -110,8 +107,7 @@ export class GrowthbookProvider implements Provider {
110107
context: EvaluationContext,
111108
): Promise<ResolutionDetails<U>> {
112109
if (!isEmpty(context)) {
113-
// Add flag evaluation context and merge with existing context
114-
await this.client.setAttributes({ ...this.client.getAttributes(), ...context });
110+
await this.client.setAttributes(context);
115111
}
116112

117113
const res = this.client.evalFeature(flagKey);

0 commit comments

Comments
 (0)