From a9c3ef6c1185ca77fed06898cb0d709a5ba607ba Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 11 Dec 2024 13:26:30 +0100 Subject: [PATCH 1/3] chore: update package-loc file --- package-lock.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index bdbaf0116..ff44513d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55694,7 +55694,7 @@ }, "packages/rum": { "name": "@elastic/apm-rum", - "version": "5.16.0", + "version": "5.16.1", "license": "MIT", "dependencies": { "@elastic/apm-rum-core": "file:../rum-core" @@ -55705,7 +55705,7 @@ }, "packages/rum-angular": { "name": "@elastic/apm-rum-angular", - "version": "3.0.3", + "version": "3.0.4", "license": "MIT", "dependencies": { "@elastic/apm-rum": "file:../rum", @@ -55727,7 +55727,7 @@ }, "packages/rum-core": { "name": "@elastic/apm-rum-core", - "version": "5.21.0", + "version": "5.21.1", "license": "MIT", "dependencies": { "error-stack-parser": "^1.3.5", @@ -55740,7 +55740,7 @@ }, "packages/rum-react": { "name": "@elastic/apm-rum-react", - "version": "2.0.2", + "version": "2.0.3", "license": "MIT", "dependencies": { "@elastic/apm-rum": "file:../rum", @@ -55764,7 +55764,7 @@ }, "packages/rum-vue": { "name": "@elastic/apm-rum-vue", - "version": "2.1.6", + "version": "2.1.7", "license": "MIT", "dependencies": { "@elastic/apm-rum": "file:../rum", From f08f6e0d5a8c4fb046586612e2b7ac4e87f1a568 Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 11 Dec 2024 16:31:38 +0100 Subject: [PATCH 2/3] fix(rum-core): fix issue when merging RUM config --- packages/rum-core/src/common/config-service.js | 2 +- packages/rum-core/src/common/utils.js | 12 +++++++----- .../rum-core/src/performance-monitoring/span-base.js | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/rum-core/src/common/config-service.js b/packages/rum-core/src/common/config-service.js index 819967174..657cde466 100644 --- a/packages/rum-core/src/common/config-service.js +++ b/packages/rum-core/src/common/config-service.js @@ -189,7 +189,7 @@ class Config { Math.round(transactionSampleRate * 10000) / 10000 } - merge(this.config, properties) + this.config = merge(this.config, properties) this.events.send(CONFIG_CHANGE, [this.config]) } diff --git a/packages/rum-core/src/common/utils.js b/packages/rum-core/src/common/utils.js index bb4ab85ea..d3ae54de3 100644 --- a/packages/rum-core/src/common/utils.js +++ b/packages/rum-core/src/common/utils.js @@ -240,7 +240,9 @@ function isFunction(value) { return typeof value === 'function' } -function baseExtend(dst, objs, deep) { +function baseExtend(objs, deep) { + var dst = Object.create(null) + for (var i = 0, ii = objs.length; i < ii; ++i) { var obj = objs[i] if (!isObject(obj) && !isFunction(obj)) continue @@ -284,12 +286,12 @@ function getCurrentScript() { } } -function extend(dst) { - return baseExtend(dst, slice.call(arguments, 1), false) +function extend() { + return baseExtend(slice.call(arguments), false) } -function merge(dst) { - return baseExtend(dst, slice.call(arguments, 1), true) +function merge() { + return baseExtend(slice.call(arguments), true) } function isUndefined(obj) { diff --git a/packages/rum-core/src/performance-monitoring/span-base.js b/packages/rum-core/src/performance-monitoring/span-base.js index f8318133c..a406ae566 100644 --- a/packages/rum-core/src/performance-monitoring/span-base.js +++ b/packages/rum-core/src/performance-monitoring/span-base.js @@ -77,7 +77,7 @@ class SpanBase { addContext(...context) { if (context.length === 0) return this.ensureContext() - merge(this.context, ...context) + this.context = merge(this.context, ...context) } end(endTime) { From a9f17b70390b2df2bb3b2b8ec857ea17e3364406 Mon Sep 17 00:00:00 2001 From: David Luna Date: Fri, 13 Dec 2024 15:11:12 +0100 Subject: [PATCH 3/3] fix(rum-core): fix merge of array props --- packages/rum-core/src/common/utils.js | 8 +++----- .../rum-core/src/performance-monitoring/transaction.js | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/rum-core/src/common/utils.js b/packages/rum-core/src/common/utils.js index d3ae54de3..cabb6aeec 100644 --- a/packages/rum-core/src/common/utils.js +++ b/packages/rum-core/src/common/utils.js @@ -240,9 +240,7 @@ function isFunction(value) { return typeof value === 'function' } -function baseExtend(objs, deep) { - var dst = Object.create(null) - +function baseExtend(dst, objs, deep) { for (var i = 0, ii = objs.length; i < ii; ++i) { var obj = objs[i] if (!isObject(obj) && !isFunction(obj)) continue @@ -287,11 +285,11 @@ function getCurrentScript() { } function extend() { - return baseExtend(slice.call(arguments), false) + return baseExtend(Object.create(null), slice.call(arguments), false) } function merge() { - return baseExtend(slice.call(arguments), true) + return baseExtend(Object.create(null), slice.call(arguments), true) } function isUndefined(obj) { diff --git a/packages/rum-core/src/performance-monitoring/transaction.js b/packages/rum-core/src/performance-monitoring/transaction.js index c4d56e780..09f2d34f8 100644 --- a/packages/rum-core/src/performance-monitoring/transaction.js +++ b/packages/rum-core/src/performance-monitoring/transaction.js @@ -88,7 +88,7 @@ class Transaction extends SpanBase { // is not setting explicitly the threshold and instead expecting to rely on the one by default. this.options.reuseThreshold = options.reuseThreshold - extend(this.options, options) + this.options = extend(this.options, options) } }