From 8e89f38d99360788864ff6b9271fc31dd5931f19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 13:45:52 +0200 Subject: [PATCH 1/5] fix: bump luxon from 3.1.1 to 3.2.1 (#87) Bumps [luxon](https://github.com/moment/luxon) from 3.1.1 to 3.2.1. - [Release notes](https://github.com/moment/luxon/releases) - [Changelog](https://github.com/moment/luxon/blob/master/CHANGELOG.md) - [Commits](https://github.com/moment/luxon/compare/3.1.1...3.2.1) --- updated-dependencies: - dependency-name: luxon dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5f4b97d0..afa97b56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17411,9 +17411,9 @@ } }, "node_modules/luxon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.1.1.tgz", - "integrity": "sha512-Ah6DloGmvseB/pX1cAmjbFvyU/pKuwQMQqz7d0yvuDlVYLTs2WeDHQMpC8tGjm1da+BriHROW/OEIT/KfYg6xw==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz", + "integrity": "sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==", "optional": true, "engines": { "node": ">=12" @@ -39681,9 +39681,9 @@ } }, "luxon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.1.1.tgz", - "integrity": "sha512-Ah6DloGmvseB/pX1cAmjbFvyU/pKuwQMQqz7d0yvuDlVYLTs2WeDHQMpC8tGjm1da+BriHROW/OEIT/KfYg6xw==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz", + "integrity": "sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==", "optional": true }, "madge": { From 2f27308edce0243d8224f124d945942d34d06f7b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 13:46:33 +0200 Subject: [PATCH 2/5] fix: bump decode-uri-component from 0.2.0 to 0.2.2 (#80) Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index afa97b56..1c59ef02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9529,9 +9529,9 @@ } }, "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true, "engines": { "node": ">=0.10" @@ -33764,9 +33764,9 @@ } }, "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true }, "decompress-response": { From 32216446ad575dd23b91269aeea9d27ba841e137 Mon Sep 17 00:00:00 2001 From: Moumita <36885121+MoumitaM@users.noreply.github.com> Date: Fri, 13 Jan 2023 17:16:34 +0530 Subject: [PATCH 3/5] fix: library info override when provided in context (#89) * fix: library info override issue when provided in context * chore: version bumped --- index.js | 2 +- package.json | 2 +- test.js | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 07373ab7..57aeefe9 100644 --- a/index.js +++ b/index.js @@ -514,11 +514,11 @@ class Analytics { lMessage.type = type; lMessage.context = { + ...lMessage.context, library: { name: 'analytics-node', version, }, - ...lMessage.context, }; lMessage.channel = 'server'; diff --git a/package.json b/package.json index b68f9f5b..f4d425f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rudderstack/rudder-sdk-node", - "version": "2.0.0", + "version": "2.0.1", "description": "Rudder Node SDK", "license": "", "repository": "rudderlabs/rudder-sdk-node", diff --git a/test.js b/test.js index e0bb74f8..4b31a75a 100644 --- a/test.js +++ b/test.js @@ -766,3 +766,26 @@ test('ensure other axios clients are not impacted by axios-retry', async (t) => server.close(); }); + +test('ensure library information not overridden if provided in context object', (t) => { + const client = createClient(); + const customContext = { + library: { + name: 'random-sdk', + version: '1234', + }, + }; + + client.enqueue( + 'type', + { + event: 'test', + context: customContext, + }, + noop, + ); + + const actualContext = client.queue[0].message.context; + + t.deepEqual(actualContext, context); +}); From 852468c738543c9f86901380e335d85f3471bcd5 Mon Sep 17 00:00:00 2001 From: Moumita <36885121+MoumitaM@users.noreply.github.com> Date: Tue, 17 Jan 2023 10:24:06 +0530 Subject: [PATCH 4/5] test: test cases added (#90) --- test.js | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/test.js b/test.js index 4b31a75a..60d8e8c3 100644 --- a/test.js +++ b/test.js @@ -787,5 +787,41 @@ test('ensure library information not overridden if provided in context object', const actualContext = client.queue[0].message.context; - t.deepEqual(actualContext, context); + t.deepEqual(actualContext.library, context.library); +}); + +test('ensure library information not overridden if provided null in context object', (t) => { + const client = createClient(); + const customContext = null; + + client.enqueue( + 'type', + { + event: 'test', + context: customContext, + }, + noop, + ); + + const actualContext = client.queue[0].message.context; + + t.deepEqual(actualContext.library, context.library); +}); + +test('ensure library information not overridden if provided undefined in context object', (t) => { + const client = createClient(); + const customContext = undefined; + + client.enqueue( + 'type', + { + event: 'test', + context: customContext, + }, + noop, + ); + + const actualContext = client.queue[0].message.context; + + t.deepEqual(actualContext.library, context.library); }); From e69ca1576048ef531112e52f0ac477af280e8d97 Mon Sep 17 00:00:00 2001 From: Moumita Date: Tue, 17 Jan 2023 10:53:22 +0530 Subject: [PATCH 5/5] chore: changelog update --- History.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index 979c3607..49114a74 100644 --- a/History.md +++ b/History.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +## [v2.0.1](https://github.com/rudderlabs/rudder-sdk-node/compare/v2.0.0...v2.0.1) + +### Fixes + +- library info override when provided in context [`#89`](https://github.com/rudderlabs/rudder-sdk-node/pull/89) + ## [v2.0.0](https://github.com/rudderlabs/rudder-sdk-node/compare/v1.1.4...v2.0.0) ### Features @@ -26,7 +32,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). ### BREAKING CHANGES -- Allow dataPlaneUrl to be be passed in options instead as an argument in initialization. [`#81`](https://github.com/rudderlabs/rudder-sdk-node/pull/81) +- Allow dataPlaneUrl to be passed in options instead as an argument in initialization and must no longer include '/v1/batch' part. [`#81`](https://github.com/rudderlabs/rudder-sdk-node/pull/81) ## [v1.1.4](https://github.com/rudderlabs/rudder-sdk-node/compare/v1.1.3...v1.1.4)