-
Notifications
You must be signed in to change notification settings - Fork 6
Evaluate without impressions: add impressionsDisabled option to feature evaluation
#452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
f4df1c9
23818e1
dd9a447
f121304
57e244f
f5b6960
0d75c9e
7be328b
25bd071
fba8bb8
e161a9e
f26c5c7
226bc67
af41862
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,12 @@ export function validateEventProperties(log: ILogger, maybeProperties: any, meth | |
| export function validateEvaluationOptions(log: ILogger, maybeOptions: any, method: string): SplitIO.EvaluationOptions | undefined { | ||
| if (isObject(maybeOptions)) { | ||
| const properties = validateEventProperties(log, maybeOptions.properties, method).properties; | ||
| return properties && Object.keys(properties).length > 0 ? { properties } : undefined; | ||
| let options = properties && Object.keys(properties).length > 0 ? { properties } : undefined; | ||
|
|
||
| const impressionsDisabled = maybeOptions.impressionsDisabled; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We would need to refactor the Eventually, if the feature is included in SDKs, the change can be rolled back. |
||
| if (!impressionsDisabled) return options; | ||
|
|
||
| return options ? { ...options, impressionsDisabled } : { impressionsDisabled }; | ||
| } else if (maybeOptions) { | ||
| log.error(ERROR_NOT_PLAIN_OBJECT, [method, 'evaluation options']); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -918,8 +918,16 @@ declare namespace SplitIO { | |
| * Evaluation options object for getTreatment methods. | ||
| */ | ||
| type EvaluationOptions = { | ||
| /** | ||
| * Whether the evaluation/s will track impressions or not. | ||
| * | ||
| * @defaultValue `false` | ||
| */ | ||
| impressionsDisabled?: boolean; | ||
|
||
| /** | ||
| * Optional properties to append to the generated impression object sent to Split backend. | ||
| * | ||
| * @defaultValue `undefined` | ||
| */ | ||
| properties?: Properties; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.