Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: error reporting plugin #1601

Merged
merged 47 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d6be68d
feat: error reporting plugin
MoumitaM Jan 30, 2024
1a7757f
chore: size limit updated
MoumitaM Jan 30, 2024
183e15c
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
MoumitaM Jan 30, 2024
edfcaa8
chore: size limit updated
MoumitaM Jan 30, 2024
3e07d44
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
MoumitaM Jan 30, 2024
97a6a99
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
MoumitaM Jan 31, 2024
97c049e
chore: refactor onerror fn and minor changes
MoumitaM Jan 31, 2024
0b2eed8
chore: review comment addressed
MoumitaM Feb 1, 2024
10f7ce8
refactor: instead of bugsnag core pkg used only required part of even…
MoumitaM Feb 7, 2024
35c89e2
chore: code refactoring
MoumitaM Feb 7, 2024
76b4305
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
MoumitaM Feb 7, 2024
cb6e0e8
chore: code refactoring
MoumitaM Feb 8, 2024
ebb0bdf
chore: review commit addressed
MoumitaM Feb 9, 2024
95e68b5
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
MoumitaM Feb 9, 2024
a05de70
chore: review comment addressed
MoumitaM Feb 9, 2024
7009640
chore: modified isruddersdkerror fn logic to filter integration sdk e…
MoumitaM Feb 11, 2024
650d8e1
chore: fix plugin loading
MoumitaM Feb 12, 2024
5a50cb3
chore: log message updated
MoumitaM Feb 12, 2024
1cdcd12
chore: resolve conflict
MoumitaM Feb 22, 2024
d2f141f
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
bardisg Feb 22, 2024
a9eccd1
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
MoumitaM Feb 26, 2024
dea1395
chore: used template literal instead of string concatenation in rollup
MoumitaM Feb 26, 2024
3b48ef4
chore: resolve merge conflicts
MoumitaM Jul 3, 2024
2a6cbd7
fix: unit test cases
MoumitaM Jul 3, 2024
86f74f3
chore: resolve merge conflict
MoumitaM Jul 4, 2024
d3e89ae
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
MoumitaM Jul 5, 2024
d2683ed
chore: unit test cases
MoumitaM Jul 8, 2024
99b3c68
chore: lock file modified
MoumitaM Jul 8, 2024
668da10
chore: more unit tests
MoumitaM Jul 8, 2024
679a0e8
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
MoumitaM Jul 8, 2024
1556c0a
chore: ignore coverage for third party code
MoumitaM Jul 8, 2024
bc486f7
chore: ignore coverage for third party code in sonar
MoumitaM Jul 9, 2024
5c3489c
chore: test cases
MoumitaM Jul 9, 2024
8ba6802
chore: ignore coverage for third party code in sonar
MoumitaM Jul 9, 2024
8dfa5f5
chore: remove reference
MoumitaM Jul 10, 2024
f217c93
chore: revert formatting changes
MoumitaM Jul 10, 2024
b29f0d7
chore: address review comments
MoumitaM Jul 11, 2024
7a13456
chore: address review comments
MoumitaM Jul 11, 2024
fd1e424
chore: updated plugin signature for backward compatibility
MoumitaM Jul 15, 2024
55a7a9f
chore: added bugsnag plugin for backward compatibility
MoumitaM Jul 17, 2024
786928c
Merge branch 'develop' into feature/sdk-1096-error-reporting-plugin
MoumitaM Jul 17, 2024
0651b04
chore: size limit updated
MoumitaM Jul 17, 2024
017be47
chore: review comment address
MoumitaM Jul 18, 2024
5ee27fc
chore: update metrics service url
MoumitaM Jul 18, 2024
0b7e6fb
chore: address review comment
MoumitaM Jul 18, 2024
e2e94f3
chore: address review comment
MoumitaM Jul 18, 2024
a1bdc87
chore: address review comment
MoumitaM Jul 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/analytics-js-common/src/constants/metrics.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const METRIC_PAYLOAD_VERSION = '1';
const METRICS_PAYLOAD_VERSION = '1';

Check warning on line 1 in packages/analytics-js-common/src/constants/metrics.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-common/src/constants/metrics.ts#L1

Added line #L1 was not covered by tests

export { METRIC_PAYLOAD_VERSION };
export { METRICS_PAYLOAD_VERSION };

Check warning on line 3 in packages/analytics-js-common/src/constants/metrics.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-common/src/constants/metrics.ts#L3

Added line #L3 was not covered by tests
8 changes: 4 additions & 4 deletions packages/analytics-js-common/src/types/ApplicationState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,22 @@ export type PluginsState = {
totalPluginsToLoad: Signal<number>;
};

export type BreadCrumbMetaData = {
export type BreadcrumbMetaData = {
[index: string]: any;
};
export type BreadcrumbType = 'error' | 'manual';
export type BreadCrumb = {
export type Breadcrumb = {
type: BreadcrumbType;
name: string;
timestamp: Date;
metaData: BreadCrumbMetaData;
metaData: BreadcrumbMetaData;
};

export type ReportingState = {
isErrorReportingEnabled: Signal<boolean>;
isMetricsReportingEnabled: Signal<boolean>;
isErrorReportingPluginLoaded: Signal<boolean>;
breadCrumbs: Signal<BreadCrumb[]>;
breadcrumbs: Signal<Breadcrumb[]>;
};

export type SessionState = {
Expand Down
6 changes: 6 additions & 0 deletions packages/analytics-js-common/src/types/ErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@
error: SDKError;
errorState: ErrorState;
};

export enum ErrorType {
HANDLEDEXCEPTION = 'handledException',
UNHANDLEDEXCEPTION = 'unhandledException',
UNHANDLEDREJECTION = 'unhandledPromiseRejection',

Check warning on line 44 in packages/analytics-js-common/src/types/ErrorHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-common/src/types/ErrorHandler.ts#L42-L44

Added lines #L42 - L44 were not covered by tests
}
4 changes: 2 additions & 2 deletions packages/analytics-js-common/src/types/Metrics.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BreadCrumb } from './ApplicationState';
import type { Breadcrumb } from './ApplicationState';

export type MetricServicePayload = {
version: string;
Expand Down Expand Up @@ -40,7 +40,7 @@ export type ErrorEventType = {
url: string;
clientIp: string;
};
breadcrumbs: BreadCrumb[] | [];
breadcrumbs: Breadcrumb[] | [];
context: string;
metaData: {
[index: string]: any;
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics-js-plugins/.size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ module.exports = [
{
name: 'Remote Module Federated Plugins - CDN',
path: 'dist/cdn/modern/plugins/rsa-plugins-*.js',
limit: '8.5 KiB',
limit: '7.5 KiB',
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Plugin - ErrorReporting', () => {
},
reporting: {
isErrorReportingPluginLoaded: signal(false),
breadCrumbs: signal([]),
breadcrumbs: signal([]),
},
context: {
locale: signal('en-GB'),
Expand All @@ -36,7 +36,7 @@ describe('Plugin - ErrorReporting', () => {
ErrorReporting().initialize(state);
expect(state.plugins.loadedPlugins.value.includes('ErrorReporting')).toBe(true);
expect(state.reporting.isErrorReportingPluginLoaded.value).toBe(true);
expect(state.reporting.breadCrumbs.value[0].name).toBe('Error Reporting Plugin Loaded');
expect(state.reporting.breadcrumbs.value[0].name).toBe('Error Reporting Plugin Loaded');
});

it('should invoke the error reporting provider plugin on notify', () => {
Expand Down Expand Up @@ -66,9 +66,9 @@ describe('Plugin - ErrorReporting', () => {
});

it('should add a new breadcrumb', () => {
const breadcrumbLength = state.reporting.breadCrumbs.value.length;
const breadcrumbLength = state.reporting.breadcrumbs.value.length;
ErrorReporting().errorReporting.breadcrumb('dummy breadcrumb', state);

expect(state.reporting.breadCrumbs.value.length).toBe(breadcrumbLength + 1);
expect(state.reporting.breadcrumbs.value.length).toBe(breadcrumbLength + 1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
isRudderSDKError,
getAppStateForMetadata,
getErrorContext,
createNewBreadCrumb,
getURLWithoutSearchParam,
enhanceErrorEvent,
createNewBreadcrumb,
getURLWithoutQueryString,
getBugsnagErrorEvent,
getErrorDeliveryPayload,
} from '../../src/errorReporting/utils';

Expand All @@ -18,10 +18,10 @@ jest.mock('@rudderstack/analytics-js-common/utilities/uuId', () => ({
}));

describe('Error Reporting utilities', () => {
describe('createNewBreadCrumb', () => {
describe('createNewBreadcrumb', () => {
it('should create and return a breadcrumb ', () => {
const msg = 'sample message';
const breadcrumb = createNewBreadCrumb(msg);
const breadcrumb = createNewBreadcrumb(msg);

expect(breadcrumb).toStrictEqual({
metaData: {},
Expand All @@ -32,10 +32,10 @@ describe('Error Reporting utilities', () => {
});
});

describe('getURLWithoutSearchParam', () => {
describe('getURLWithoutQueryString', () => {
it('should return url without query param ', () => {
(window as any).location.href = 'http://www.test-host.com?key1=1234&key2=true';
const urlWithoutSearchParam = getURLWithoutSearchParam();
const urlWithoutSearchParam = getURLWithoutQueryString();
expect(urlWithoutSearchParam).toEqual('http://www.test-host.com/');
});
});
Expand Down Expand Up @@ -283,7 +283,7 @@ describe('Error Reporting utilities', () => {
});
});

describe('enhanceErrorEvent', () => {
describe('getBugsnagErrorEvent', () => {
it('should return enhanced error event payload', () => {
const newError = new Error();
const normalizedError = Object.create(newError, {
Expand All @@ -309,12 +309,12 @@ describe('Error Reporting utilities', () => {
writeKey: signal('sample-write-key'),
},
reporting: {
breadCrumbs: signal([]),
breadcrumbs: signal([]),
},
source: signal({ id: 'sample_source_id' }),
};
(window as any).RudderSnippetVersion = 'sample_snippet_version';
const enhancedError = enhanceErrorEvent(errorPayload, errorState, appState);
const enhancedError = getBugsnagErrorEvent(errorPayload, errorState, appState);
console.log(JSON.stringify(enhancedError));
const expectedOutcome = {
notifier: {
Expand Down Expand Up @@ -363,11 +363,11 @@ describe('Error Reporting utilities', () => {
breadcrumbs: [],
context: 'ReferenceError: testUndefinedFn is not defined',
metaData: {
SDK: {
sdk: {
name: 'JS',
installType: '__MODULE_TYPE__',
},
STATE: {
state: {
context: {
userAgent: 'sample user agent',
locale: 'en-GB',
Expand All @@ -379,13 +379,13 @@ describe('Error Reporting utilities', () => {
writeKey: 'sample-write-key',
},
reporting: {
breadCrumbs: [],
breadcrumbs: [],
},
source: {
id: 'sample_source_id',
},
},
SOURCE: {
source: {
id: 'sample_source_id',
snippetVersion: 'sample_snippet_version',
},
Expand Down Expand Up @@ -457,11 +457,11 @@ describe('Error Reporting utilities', () => {
breadcrumbs: [],
context: 'ReferenceError: testUndefinedFn is not defined',
metaData: {
SDK: {
sdk: {
name: 'JS',
installType: '__MODULE_TYPE__',
},
STATE: {
state: {
context: {
userAgent: 'sample user agent',
locale: 'en-GB',
Expand All @@ -470,7 +470,7 @@ describe('Error Reporting utilities', () => {
lifecycle: {
writeKey: 'sample-write-key',
},
breadCrumbs: [],
breadcrumbs: [],
},
},
user: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ErrorStackParser from 'error-stack-parser';
import type { Exception, Stackframe } from '@rudderstack/analytics-js-common/types/Metrics';
import type { FrameType, IErrorFormat } from '../types';
import { hasStack, isError } from '../utils';
import { hasStack, isError } from './utils';

const normaliseFunctionName = (name: string) =>
/^global code$/i.test(name) ? 'global code' : name;
Expand All @@ -24,7 +24,7 @@
// - non-error exception thrown from global code in FF
// This adds one.
if (f.lineNumber > -1 && !f.file && !f.method) {
f.file = 'global code';

Check warning on line 27 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L27

Added line #L27 was not covered by tests
}
return f;
};
Expand All @@ -47,7 +47,7 @@
if (JSON.stringify(f) === '{}') return accum;
return accum.concat(f);
} catch (e) {
return accum;

Check warning on line 50 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L50

Added line #L50 was not covered by tests
}
}, []),
};
Expand All @@ -57,7 +57,7 @@

const getStacktrace = (error: any, errorFramesToSkip: number) => {
if (hasStack(error)) return ErrorStackParser.parse(error).slice(errorFramesToSkip);
return [];

Check warning on line 60 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L60

Added line #L60 was not covered by tests
};

const hasNecessaryFields = (error: any) =>
Expand All @@ -76,11 +76,11 @@
const createAndLogInputError = (reason: string) => {
const verb = component === 'error cause' ? 'was' : 'received';
if (logger) logger.warn(`${component} ${verb} a non-error: "${reason}"`);
const err = new Error(

Check warning on line 79 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L79

Added line #L79 was not covered by tests
`${component} ${verb} a non-error. See "${component}" tab for more detail.`,
);
err.name = 'InvalidError';
return err;

Check warning on line 83 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L82-L83

Added lines #L82 - L83 were not covered by tests
};

// In some cases:
Expand All @@ -93,52 +93,52 @@
// such.
if (!tolerateNonErrors) {
if (isError(maybeError)) {
error = maybeError;

Check warning on line 96 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L96

Added line #L96 was not covered by tests
} else {
error = createAndLogInputError(typeof maybeError);
internalFrames += 2;

Check warning on line 99 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L98-L99

Added lines #L98 - L99 were not covered by tests
}
} else {
switch (typeof maybeError) {
case 'string':
case 'number':
case 'boolean':
error = new Error(String(maybeError));
internalFrames += 1;
break;

Check warning on line 108 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L106-L108

Added lines #L106 - L108 were not covered by tests
case 'function':
error = createAndLogInputError('function');
internalFrames += 2;
break;

Check warning on line 112 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L110-L112

Added lines #L110 - L112 were not covered by tests
case 'object':
if (maybeError !== null && isError(maybeError)) {
error = maybeError;
} else if (maybeError !== null && hasNecessaryFields(maybeError)) {
error = new Error(maybeError.message || maybeError.errorMessage);
error.name = maybeError.name || maybeError.errorClass;
internalFrames += 1;

Check warning on line 119 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L119

Added line #L119 was not covered by tests
} else {
error = createAndLogInputError(maybeError === null ? 'null' : 'unsupported object');
internalFrames += 2;

Check warning on line 122 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L122

Added line #L122 was not covered by tests
}
break;
default:
error = createAndLogInputError('nothing');
internalFrames += 2;

Check warning on line 127 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L126-L127

Added lines #L126 - L127 were not covered by tests
}
}

if (!hasStack(error)) {
// in IE10/11 a new Error() doesn't have a stacktrace until you throw it, so try that here
try {
throw error;

Check warning on line 134 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L133-L134

Added lines #L133 - L134 were not covered by tests
} catch (e) {
if (hasStack(e)) {
error = e;

Check warning on line 137 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L137

Added line #L137 was not covered by tests
// if the error only got a stacktrace after we threw it here, we know it
// will only have one extra internal frame from this function, regardless
// of whether it went through createAndLogInputError() or not
internalFrames = 1;

Check warning on line 141 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L141

Added line #L141 was not covered by tests
}
}
}
Expand Down Expand Up @@ -178,7 +178,7 @@
);
event = new ErrorFormat(error.name, error.message, stacktrace);
} catch (e) {
event = new ErrorFormat(error.name, error.message, []);

Check warning on line 181 in packages/analytics-js-plugins/src/errorReporting/event/event.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/event.ts#L181

Added line #L181 was not covered by tests
}

return event;
Expand Down
18 changes: 18 additions & 0 deletions packages/analytics-js-plugins/src/errorReporting/event/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const hasStack = (err: any) =>
!!err &&
(!!err.stack || !!err.stacktrace || !!err['opera#sourceloc']) &&
typeof (err.stack || err.stacktrace || err['opera#sourceloc']) === 'string' &&
err.stack !== `${err.name}: ${err.message}`;

const isError = (value: any) => {
switch (Object.prototype.toString.call(value)) {
case '[object Error]':
case '[object Exception]':
case '[object DOMException]':
return true;

Check warning on line 12 in packages/analytics-js-plugins/src/errorReporting/event/utils.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/event/utils.ts#L12

Added line #L12 was not covered by tests
default:
return value instanceof Error;
}
};

export { hasStack, isError };
20 changes: 10 additions & 10 deletions packages/analytics-js-plugins/src/errorReporting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
/* eslint-disable no-param-reassign */
import type {
ApplicationState,
BreadCrumbMetaData,
BreadcrumbMetaData,
} from '@rudderstack/analytics-js-common/types/ApplicationState';
import type { ExtensionPlugin } from '@rudderstack/analytics-js-common/types/PluginEngine';
import type { ILogger } from '@rudderstack/analytics-js-common/types/Logger';
import type { PluginName } from '@rudderstack/analytics-js-common/types/PluginsManager';
import type { ErrorState, SDKError } from '@rudderstack/analytics-js-common/types/ErrorHandler';
import type { IHttpClient } from '@rudderstack/analytics-js-common/types/HttpClient';
import {
createNewBreadCrumb,
createNewBreadcrumb,
getConfigForPayloadCreation,
isRudderSDKError,
enhanceErrorEvent,
getBugsnagErrorEvent,
getErrorDeliveryPayload,
} from './utils';
import { REQUEST_TIMEOUT_MS } from './constants';
Expand All @@ -27,7 +27,7 @@
initialize: (state: ApplicationState) => {
state.plugins.loadedPlugins.value = [...state.plugins.loadedPlugins.value, pluginName];
state.reporting.isErrorReportingPluginLoaded.value = true;
state.reporting.breadCrumbs.value = [createNewBreadCrumb('Error Reporting Plugin Loaded')];
state.reporting.breadcrumbs.value = [createNewBreadcrumb('Error Reporting Plugin Loaded')];
},
errorReporting: {
notify: (
saikumarrs marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -42,7 +42,7 @@

// filter errors
if (!isRudderSDKError(normalizedError)) {
return;

Check warning on line 45 in packages/analytics-js-plugins/src/errorReporting/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/index.ts#L45

Added line #L45 was not covered by tests
}

// Generate the error payload
Expand All @@ -56,15 +56,15 @@
);

// enrich error payload
const enhancedError = enhanceErrorEvent(errorPayload, errorState, state);
const bugsnagPayload = getBugsnagErrorEvent(errorPayload, errorState, state);

// send it to metrics service
httpClient.getAsyncData({
url: `https://sdk-metrics.rudderstack.com/sdkmetrics`,
saikumarrs marked this conversation as resolved.
Show resolved Hide resolved
// url: `${state.lifecycle.dataPlaneUrl.value}/sdk-metrics`,
options: {
method: 'POST',
data: getErrorDeliveryPayload(enhancedError, state),
data: getErrorDeliveryPayload(bugsnagPayload, state),
sendRawData: true,
},
isRawResponse: true,
Expand All @@ -74,13 +74,13 @@
},
});
},
breadcrumb: (message: string, state: ApplicationState, metaData?: BreadCrumbMetaData): void => {
breadcrumb: (message: string, state: ApplicationState, metaData?: BreadcrumbMetaData): void => {
saikumarrs marked this conversation as resolved.
Show resolved Hide resolved
if (!message) {
return;

Check warning on line 79 in packages/analytics-js-plugins/src/errorReporting/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/analytics-js-plugins/src/errorReporting/index.ts#L79

Added line #L79 was not covered by tests
}
state.reporting.breadCrumbs.value = [
...state.reporting.breadCrumbs.value,
createNewBreadCrumb(message, metaData),
state.reporting.breadcrumbs.value = [
...state.reporting.breadcrumbs.value,
createNewBreadcrumb(message, metaData),
];
},
},
Expand Down
Loading
Loading