Skip to content

Commit

Permalink
pick only the options required for sending events
Browse files Browse the repository at this point in the history
  • Loading branch information
atrakh committed Oct 25, 2024
1 parent d129d28 commit d1eb214
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@
"dependencies": {
"@launchdarkly/js-server-sdk-common": "2.8.0",
"crypto-js": "^4.2.0",
"lodash.isequal": "^4.5.0"
"lodash.isequal": "^4.5.0",
"lodash.pick": "^4.4.0"
},
"devDependencies": {
"@eslint/js": "^9.9.1",
"@fast-check/vitest": "^0.1.3",
"@types/crypto-js": "^4.2.2",
"@types/lodash.isequal": "^4.5.8",
"@types/lodash.pick": "^4.4.9",
"@types/node": "^18.17.0",
"@vitest/coverage-v8": "^2.1.1",
"convex-test": "^0.0.33",
Expand Down
7 changes: 6 additions & 1 deletion src/component/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
validateEventProcessorOptions,
} from "../sdk/EventProcessor";
import isEqual from "lodash.isequal";
import pick from "lodash.pick";

export const EVENT_CAPACITY = 1000;
export const EVENT_BATCH_SIZE = 100;
Expand Down Expand Up @@ -148,7 +149,11 @@ export const processEvents = internalAction({
return;
}

await sendEvents(events, sdkKey, options);
await sendEvents(
events,
sdkKey,
pick(options, ["allAttributesPrivate", "privateAttributes", "eventsUri"])
);

// If we fail to send events, we won't end up deleting them.
// Next time an event is stored, we will try to send them again.
Expand Down

0 comments on commit d1eb214

Please sign in to comment.