diff --git a/contract-tests/index.js b/contract-tests/index.js index 06430d0a5..d72543907 100644 --- a/contract-tests/index.js +++ b/contract-tests/index.js @@ -31,6 +31,7 @@ app.get('/', (req, res) => { 'migrations', 'event-sampling', 'strongly-typed', + 'inline-context', ], }); }); diff --git a/packages/shared/common/__tests__/internal/events/EventProcessor.test.ts b/packages/shared/common/__tests__/internal/events/EventProcessor.test.ts index 47c28b0bf..d01fce4b9 100644 --- a/packages/shared/common/__tests__/internal/events/EventProcessor.test.ts +++ b/packages/shared/common/__tests__/internal/events/EventProcessor.test.ts @@ -73,19 +73,11 @@ function makeFeatureEvent( variation, value, default: def, - ...(debug - ? { - context: { - key: 'userKey', - name: 'Red', - kind: 'user', - }, - } - : { - contextKeys: { - user: 'userKey', - }, - }), + context: { + key: 'userKey', + name: 'Red', + kind: 'user', + }, }; } diff --git a/packages/shared/common/src/internal/events/EventProcessor.ts b/packages/shared/common/src/internal/events/EventProcessor.ts index 505fa16f9..9abac2e05 100644 --- a/packages/shared/common/src/internal/events/EventProcessor.ts +++ b/packages/shared/common/src/internal/events/EventProcessor.ts @@ -261,6 +261,7 @@ export default class EventProcessor implements LDEventProcessor { const out: FeatureOutputEvent = { kind: debug ? 'debug' : 'feature', creationDate: event.creationDate, + context: this.contextFilter.filter(event.context), key: event.key, value: event.value, default: event.default, @@ -280,11 +281,6 @@ export default class EventProcessor implements LDEventProcessor { if (event.reason) { out.reason = event.reason; } - if (debug) { - out.context = this.contextFilter.filter(event.context); - } else { - out.contextKeys = event.context.kindsAndKeys; - } return out; } case 'index': // Intentional fallthrough.