@newrelic/browser-agent 1.320.1-rc.3 → 1.320.1-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.320.1-rc.3";
20
+ const VERSION = exports.VERSION = "1.320.1-rc.5";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.320.1-rc.3";
20
+ const VERSION = exports.VERSION = "1.320.1-rc.5";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -88,6 +88,8 @@ class Connector {
88
88
  // Double check that there isn't a response saved (e.g. from another agent/browser tab) btwn the async time of the request and now in a race-condition.
89
89
  const cachedResp = session.state.cachedRumResponse;
90
90
  if (cachedResp) {
91
+ // Report that we've seen a race condition on updating session state
92
+ (0, _handle.handle)(_constants.SUPPORTABILITY_METRIC_CHANNEL, ['Session/RaceCondition/Seen'], undefined, _features.FEATURE_NAMES.metrics, this.#agentRef.ee);
91
93
  // `cachedRumResponse` is stored flat (`{ app, ...flags }`, matching the old v1 RUM response), so re-nest it before applying.
92
94
  const {
93
95
  app,
@@ -9,7 +9,7 @@ exports.isPreloadAllowed = isPreloadAllowed;
9
9
  var _nreum = require("../../../common/window/nreum");
10
10
  var _featureGates = require("../../utils/feature-gates");
11
11
  /**
12
- * Copyright 2020-2025 New Relic, Inc. All rights reserved.
12
+ * Copyright 2020-2026 New Relic, Inc. All rights reserved.
13
13
  * SPDX-License-Identifier: Apache-2.0
14
14
  */
15
15
 
@@ -25,10 +25,8 @@ function isPreloadAllowed(agentInit) {
25
25
  }
26
26
  function customMasker(text, element) {
27
27
  try {
28
- if (typeof element?.type === 'string') {
29
- if (element.type.toLowerCase() === 'password') return '*'.repeat(text?.length || 0);
30
- if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text;
31
- }
28
+ if (typeof element?.type === 'string' && element.type.toLowerCase() === 'password') return '*'.repeat(text?.length || 0);
29
+ if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text;
32
30
  } catch (err) {
33
31
  // likely an element was passed to this handler that was invalid and was missing attributes or methods
34
32
  }
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.320.1-rc.3";
14
+ export const VERSION = "1.320.1-rc.5";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.320.1-rc.3";
14
+ export const VERSION = "1.320.1-rc.5";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -82,6 +82,8 @@ export class Connector {
82
82
  // Double check that there isn't a response saved (e.g. from another agent/browser tab) btwn the async time of the request and now in a race-condition.
83
83
  const cachedResp = session.state.cachedRumResponse;
84
84
  if (cachedResp) {
85
+ // Report that we've seen a race condition on updating session state
86
+ handle(SUPPORTABILITY_METRIC_CHANNEL, ['Session/RaceCondition/Seen'], undefined, FEATURE_NAMES.metrics, this.#agentRef.ee);
85
87
  // `cachedRumResponse` is stored flat (`{ app, ...flags }`, matching the old v1 RUM response), so re-nest it before applying.
86
88
  const {
87
89
  app,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2020-2025 New Relic, Inc. All rights reserved.
2
+ * Copyright 2020-2026 New Relic, Inc. All rights reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { gosNREUMOriginals } from '../../../common/window/nreum';
@@ -16,10 +16,8 @@ export function isPreloadAllowed(agentInit) {
16
16
  }
17
17
  export function customMasker(text, element) {
18
18
  try {
19
- if (typeof element?.type === 'string') {
20
- if (element.type.toLowerCase() === 'password') return '*'.repeat(text?.length || 0);
21
- if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text;
22
- }
19
+ if (typeof element?.type === 'string' && element.type.toLowerCase() === 'password') return '*'.repeat(text?.length || 0);
20
+ if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text;
23
21
  } catch (err) {
24
22
  // likely an element was passed to this handler that was invalid and was missing attributes or methods
25
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/connector.js"],"names":[],"mappings":"AAmBA;IAKE,2BAeC;IAED,+CAiBC;;CA6GF"}
1
+ {"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/connector.js"],"names":[],"mappings":"AAmBA;IAKE,2BAeC;IAED,+CAiBC;;CA+GF"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/utils.js"],"names":[],"mappings":"AAOA,+DAIC;AAED,0DAEC;AAED,2DAUC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/shared/utils.js"],"names":[],"mappings":"AAOA,+DAIC;AAED,0DAEC;AAED,2DAQC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.320.1-rc.3",
3
+ "version": "1.320.1-rc.5",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -71,6 +71,8 @@ export class Connector {
71
71
  // Double check that there isn't a response saved (e.g. from another agent/browser tab) btwn the async time of the request and now in a race-condition.
72
72
  const cachedResp = session.state.cachedRumResponse
73
73
  if (cachedResp) {
74
+ // Report that we've seen a race condition on updating session state
75
+ handle(SUPPORTABILITY_METRIC_CHANNEL, ['Session/RaceCondition/Seen'], undefined, FEATURE_NAMES.metrics, this.#agentRef.ee)
74
76
  // `cachedRumResponse` is stored flat (`{ app, ...flags }`, matching the old v1 RUM response), so re-nest it before applying.
75
77
  const { app, ...config } = cachedResp
76
78
  this.#applyConnectResponse({ app, config })
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2020-2025 New Relic, Inc. All rights reserved.
2
+ * Copyright 2020-2026 New Relic, Inc. All rights reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { gosNREUMOriginals } from '../../../common/window/nreum'
@@ -17,10 +17,8 @@ export function isPreloadAllowed (agentInit) {
17
17
 
18
18
  export function customMasker (text, element) {
19
19
  try {
20
- if (typeof element?.type === 'string') {
21
- if (element.type.toLowerCase() === 'password') return '*'.repeat(text?.length || 0)
22
- if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text
23
- }
20
+ if (typeof element?.type === 'string' && element.type.toLowerCase() === 'password') return '*'.repeat(text?.length || 0)
21
+ if (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask')) return text
24
22
  } catch (err) {
25
23
  // likely an element was passed to this handler that was invalid and was missing attributes or methods
26
24
  }