From cda3a11b6981289c90cfd0a9383a990cc6761572 Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Mon, 4 Sep 2023 11:31:42 +1200 Subject: [PATCH 01/15] Added client info to rum payload --- src/raygun.rum/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/raygun.rum/index.js b/src/raygun.rum/index.js index 0a649cd1..e1f1c019 100644 --- a/src/raygun.rum/index.js +++ b/src/raygun.rum/index.js @@ -287,6 +287,10 @@ var raygunRumFactory = function (window, $, Raygun) { version: self.version || 'Not supplied', tags: self.tags, device: window.raygunUserAgent, + client: { + name: "raygun4js", + version: '{{VERSION}}' + }, })); } @@ -602,8 +606,8 @@ var raygunRumFactory = function (window, $, Raygun) { url: response.baseUrl, statusCode: response.status, timing: { - du: maxFiveMinutes(response.duration).toFixed(2), - a: offset.toFixed(2), + du: maxFiveMinutes(response.duration).toFixed(2) || 0, + a: offset.toFixed(2) || 0, t: Timings.XHR }, }; @@ -1255,6 +1259,10 @@ var raygunRumFactory = function (window, $, Raygun) { user: self.user, version: self.version || 'Not supplied', device: window.raygunUserAgent, + client: { + name: "raygun4js", + version: '{{VERSION}}' + }, tags: self.tags, data: data, }); From 5953fba0e1cb800e3ac3a9666b18c704e426a259 Mon Sep 17 00:00:00 2001 From: Hamish Taylor <48536946+Hamish-taylor@users.noreply.github.com> Date: Mon, 4 Sep 2023 11:53:22 +1200 Subject: [PATCH 02/15] Update src/raygun.rum/index.js Co-authored-by: Darcy --- src/raygun.rum/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raygun.rum/index.js b/src/raygun.rum/index.js index e1f1c019..6aa8b107 100644 --- a/src/raygun.rum/index.js +++ b/src/raygun.rum/index.js @@ -607,7 +607,7 @@ var raygunRumFactory = function (window, $, Raygun) { statusCode: response.status, timing: { du: maxFiveMinutes(response.duration).toFixed(2) || 0, - a: offset.toFixed(2) || 0, + a: (offset || 0).toFixed(2), t: Timings.XHR }, }; From 40bfb2b32320c330c835b010b2d8516fc19d5eb5 Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Mon, 4 Sep 2023 12:37:10 +1200 Subject: [PATCH 03/15] Added extra null check --- src/raygun.rum/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/raygun.rum/index.js b/src/raygun.rum/index.js index 6aa8b107..bf3122fc 100644 --- a/src/raygun.rum/index.js +++ b/src/raygun.rum/index.js @@ -606,12 +606,11 @@ var raygunRumFactory = function (window, $, Raygun) { url: response.baseUrl, statusCode: response.status, timing: { - du: maxFiveMinutes(response.duration).toFixed(2) || 0, + du: maxFiveMinutes(response.duration || 0).toFixed(2), //These are hacks to stop a potential situation where duration and/or offset are NaN, this is not a feature and needs to be fixed a: (offset || 0).toFixed(2), t: Timings.XHR }, }; - collection.push(attachParentResource(payload, response.parentResource)); } } while (responses.length > 0); From 2f166e58548131fbee90329710668657f98d632d Mon Sep 17 00:00:00 2001 From: Darcy Thomas Date: Mon, 4 Sep 2023 13:51:33 +1200 Subject: [PATCH 04/15] Update CHANGELOG.md --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d44c337a..5fca74c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rolls back the previous change + +## [2.27.2] + +### Changed + +- Rolls back the previous change which causes issues for typescript users +- Adds client provider (version) information +- Adds defaults for timing information payload information + ## [2.27.1] ### Changed From 9fde6494b7d88874e9bd63be7471ff10db57e8d4 Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Mon, 4 Sep 2023 15:19:33 +1200 Subject: [PATCH 05/15] Added null check to custom data --- src/raygun.loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raygun.loader.js b/src/raygun.loader.js index ab2baeb0..f93c6ceb 100644 --- a/src/raygun.loader.js +++ b/src/raygun.loader.js @@ -158,7 +158,7 @@ if (value.type && value.path) { rg.trackEvent(value.type, { path: value.path }); } else if(value.type && value.name && value.duration) { - rg.trackEvent(value.type, { name: value.name, duration: value.duration, offset: value.offset }); + rg.trackEvent(value.type, { name: value.name, duration: value.duration, offset: value.offset || 0 }); } else if (value.type && value.timings) { rg.trackEvent(value.type, { timings: value.timings }); } From 4c9724dd5e141d3b6e48d2e849b0d581087f7ba1 Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Mon, 4 Sep 2023 16:25:23 +1200 Subject: [PATCH 06/15] added null checks for virtual pages --- src/raygun.js | 2 +- src/raygun.rum/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raygun.js b/src/raygun.js index b4576197..7cb050f7 100644 --- a/src/raygun.js +++ b/src/raygun.js @@ -378,7 +378,7 @@ var raygunFactory = function (window, $, undefined) { if (type === 'pageView' && options.path) { _rum.virtualPageLoaded(options.path); } else if (type === 'customTiming') { - _rum.trackCustomTiming(options.name, options.duration, options.offset, parentResource); + _rum.trackCustomTiming(options.name, options.duration, options.offset || 0, parentResource); } else if (type === 'customTimings' && options.timings) { _rum.sendCustomTimings(options.timings, parentResource); } diff --git a/src/raygun.rum/index.js b/src/raygun.rum/index.js index bf3122fc..58729de2 100644 --- a/src/raygun.rum/index.js +++ b/src/raygun.rum/index.js @@ -827,7 +827,7 @@ var raygunRumFactory = function (window, $, Raygun) { var data = { du: maxFiveMinutes(getTimingDuration(timing)).toFixed(2), t: getSecondaryTimingType(timing), - a: offset + timing.fetchStart, + a: offset + timing.fetchStart || timing.startTime || 0, }; if (timing.domainLookupStart && timing.domainLookupStart > 0) { From fe475fe75ff6375b674733e13a07a8bcccbf0f36 Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Tue, 5 Sep 2023 10:25:44 +1200 Subject: [PATCH 07/15] Fixed incorrect null check --- src/raygun.rum/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raygun.rum/index.js b/src/raygun.rum/index.js index 58729de2..c7bf9e86 100644 --- a/src/raygun.rum/index.js +++ b/src/raygun.rum/index.js @@ -827,7 +827,7 @@ var raygunRumFactory = function (window, $, Raygun) { var data = { du: maxFiveMinutes(getTimingDuration(timing)).toFixed(2), t: getSecondaryTimingType(timing), - a: offset + timing.fetchStart || timing.startTime || 0, + a: offset + (timing.fetchStart || timing.startTime || 0), }; if (timing.domainLookupStart && timing.domainLookupStart > 0) { From 82c23ed6ed9fdb6235379ed997270e8ad97e0339 Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Tue, 5 Sep 2023 15:27:31 +1200 Subject: [PATCH 08/15] Added null checks, rewrote NaN Check --- src/raygun.rum/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/raygun.rum/index.js b/src/raygun.rum/index.js index c7bf9e86..80b32a7e 100644 --- a/src/raygun.rum/index.js +++ b/src/raygun.rum/index.js @@ -734,7 +734,7 @@ var raygunRumFactory = function (window, $, Raygun) { t: Timings.Page, }; - data.a = timing.fetchStart; + data.a = timing.fetchStart || 0; if (timing.domainLookupStart && timing.domainLookupStart > 0) { data.b = timing.domainLookupStart - data.a; @@ -827,7 +827,7 @@ var raygunRumFactory = function (window, $, Raygun) { var data = { du: maxFiveMinutes(getTimingDuration(timing)).toFixed(2), t: getSecondaryTimingType(timing), - a: offset + (timing.fetchStart || timing.startTime || 0), + a: (offset || 0) + (timing.fetchStart || timing.startTime || 0), }; if (timing.domainLookupStart && timing.domainLookupStart > 0) { @@ -1206,7 +1206,7 @@ var raygunRumFactory = function (window, $, Raygun) { function sanitizeNaNs(data) { for (var i in data) { - if (isNaN(data[i]) && typeof data[i] !== 'string') { + if (data[i] === "NaN") { data[i] = 0; } } From a3ea45858d99a2fb27ddf0c1bf4d2b451b20ca7a Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Wed, 6 Sep 2023 10:35:25 +1200 Subject: [PATCH 09/15] added comments --- src/raygun.rum/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raygun.rum/index.js b/src/raygun.rum/index.js index 80b32a7e..d9c9b299 100644 --- a/src/raygun.rum/index.js +++ b/src/raygun.rum/index.js @@ -287,7 +287,7 @@ var raygunRumFactory = function (window, $, Raygun) { version: self.version || 'Not supplied', tags: self.tags, device: window.raygunUserAgent, - client: { + client: { //This is incomplete, it does not add the client data to every payload that is sent name: "raygun4js", version: '{{VERSION}}' }, @@ -1258,7 +1258,7 @@ var raygunRumFactory = function (window, $, Raygun) { user: self.user, version: self.version || 'Not supplied', device: window.raygunUserAgent, - client: { + client: { //This is incomplete, it does not add the client data to every payload that is sent name: "raygun4js", version: '{{VERSION}}' }, From e6862ad5360d6a07ed3706d069a52575d8b80073 Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Fri, 8 Sep 2023 09:08:41 +1200 Subject: [PATCH 10/15] Bumped version from patch to minor --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fca74c3..6333ad5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 -## [2.27.2] +## [2.28.0] ### Changed From 61b769bf6d524fdcb758215a5d4be2472afb2ffd Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Mon, 18 Sep 2023 14:37:46 +1200 Subject: [PATCH 11/15] Bumped version --- bower.json | 2 +- package.json | 2 +- raygun4js.nuspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 5f4ebce8..25017d2e 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "raygun4js", - "version": "2.27.3", + "version": "2.28.0", "homepage": "http://raygun.com", "authors": [ "Mindscape " diff --git a/package.json b/package.json index 613a5393..00b789f6 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ ], "title": "Raygun4js", "description": "Raygun.com plugin for JavaScript", - "version": "2.27.3", + "version": "2.28.0", "homepage": "https://github.com/MindscapeHQ/raygun4js", "author": { "name": "MindscapeHQ", diff --git a/raygun4js.nuspec b/raygun4js.nuspec index 4ae03cfc..cd0bfac3 100644 --- a/raygun4js.nuspec +++ b/raygun4js.nuspec @@ -2,7 +2,7 @@ raygun4js - 2.27.3 + 2.28.0 Raygun4js Raygun Limited Raygun Limited From 4cae7aa3dc0b8ea0469a2a10a69f61fbc6e5ebb6 Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Mon, 18 Sep 2023 15:09:09 +1200 Subject: [PATCH 12/15] Rearranged changelog --- CHANGELOG.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6333ad5e..4148a86c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Unused normalize.css file --> +## [2.28.0] + +### Changed + +- Adds client provider (version) information +- Adds defaults for timing information payload information + ## [2.27.3] ### Changed @@ -44,14 +51,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 -## [2.28.0] - -### Changed - -- Rolls back the previous change which causes issues for typescript users -- Adds client provider (version) information -- Adds defaults for timing information payload information - ## [2.27.1] ### Changed From a623d10a2ef2d04270831605b028a435566edbdc Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Mon, 18 Sep 2023 15:16:30 +1200 Subject: [PATCH 13/15] Fixed spacing --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4148a86c..0f2539f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Adds client provider (version) information - Adds defaults for timing information payload information + ## [2.27.3] ### Changed @@ -42,7 +43,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixes a rare condition with UMD where we assume rg4js is initialised but it is not, causing an infinite loop. - ## [2.27.2] ### Changed @@ -50,7 +50,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rolls back the previous change - ## [2.27.1] ### Changed From 2bb33b7d5d6160cee91b8c968644c1dc85b9ac27 Mon Sep 17 00:00:00 2001 From: Hamish Taylor <48536946+Hamish-taylor@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:27:26 +1200 Subject: [PATCH 14/15] Update src/raygun.rum/index.js Co-authored-by: Sean Chapman --- src/raygun.rum/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raygun.rum/index.js b/src/raygun.rum/index.js index d9c9b299..203b3c19 100644 --- a/src/raygun.rum/index.js +++ b/src/raygun.rum/index.js @@ -1206,7 +1206,7 @@ var raygunRumFactory = function (window, $, Raygun) { function sanitizeNaNs(data) { for (var i in data) { - if (data[i] === "NaN") { + if (data[i] === "NaN" || data[i] === NaN) { data[i] = 0; } } From 9f1d2bcb24e5f6d6a7621afbdf4b9e46d49e9279 Mon Sep 17 00:00:00 2001 From: hamish taylor Date: Mon, 18 Sep 2023 15:42:08 +1200 Subject: [PATCH 15/15] Fixed number NaN check --- src/raygun.rum/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raygun.rum/index.js b/src/raygun.rum/index.js index 203b3c19..5e6783d6 100644 --- a/src/raygun.rum/index.js +++ b/src/raygun.rum/index.js @@ -1206,7 +1206,7 @@ var raygunRumFactory = function (window, $, Raygun) { function sanitizeNaNs(data) { for (var i in data) { - if (data[i] === "NaN" || data[i] === NaN) { + if (data[i] === "NaN" || Number.isNaN(data[i])) { data[i] = 0; } }