From 8caf104d91fdebfd83df18effe95c3eee18ab907 Mon Sep 17 00:00:00 2001 From: Kiko Ruiz Date: Mon, 25 Nov 2024 16:16:19 +0100 Subject: [PATCH] feat(packages/sui-segment-wrapper): send version always --- packages/sui-segment-wrapper/src/segmentWrapper.js | 3 +-- packages/sui-segment-wrapper/test/segmentWrapperSpec.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/sui-segment-wrapper/src/segmentWrapper.js b/packages/sui-segment-wrapper/src/segmentWrapper.js index 70d3cfceb..f990e39fe 100644 --- a/packages/sui-segment-wrapper/src/segmentWrapper.js +++ b/packages/sui-segment-wrapper/src/segmentWrapper.js @@ -127,7 +127,6 @@ export const decorateContextWithNeededData = async ({event = '', context = {}}) getTrackIntegrations({gdprPrivacyValue, event}), getXandrId({gdprPrivacyValueAdvertising}) ]) - const version = process.env.VERSION if (!isGdprAccepted) { context.integrations = { @@ -148,7 +147,7 @@ export const decorateContextWithNeededData = async ({event = '', context = {}}) ...context.integrations, ...integrations }, - clientVersion: `segment-wrapper${version ? `@${version}` : ''}` + clientVersion: `segment-wrapper@${process.env.VERSION ?? '0.0.0'}` } } diff --git a/packages/sui-segment-wrapper/test/segmentWrapperSpec.js b/packages/sui-segment-wrapper/test/segmentWrapperSpec.js index e3dd00276..3bf1cb7c4 100644 --- a/packages/sui-segment-wrapper/test/segmentWrapperSpec.js +++ b/packages/sui-segment-wrapper/test/segmentWrapperSpec.js @@ -755,7 +755,8 @@ describe('Segment Wrapper', function () { gdpr_privacy_advertising: 'declined', context: { integrations - } + }, + clientVersion: 'segment-wrapper@0.0.0' } const {traits} = spy.getCall(0).firstArg.obj.context