From cfa020c063c1fe69c784d173f57576b053005953 Mon Sep 17 00:00:00 2001 From: Nikhil Nandagopal Date: Wed, 9 Dec 2020 11:50:39 +0530 Subject: [PATCH 1/3] pruned expensive redux actions and console logs from sentry --- app/client/src/utils/AppsmithUtils.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/client/src/utils/AppsmithUtils.tsx b/app/client/src/utils/AppsmithUtils.tsx index c643289332..9b5ddfdd2e 100644 --- a/app/client/src/utils/AppsmithUtils.tsx +++ b/app/client/src/utils/AppsmithUtils.tsx @@ -46,7 +46,23 @@ export const appInitializer = () => { FeatureFlag.initialize(appsmithConfigs.featureFlag); if (appsmithConfigs.sentry.enabled) { - Sentry.init(appsmithConfigs.sentry); + Sentry.init({ + ...appsmithConfigs.sentry, + beforeBreadcrumb(breadcrumb, hint) { + if (breadcrumb.category === "console") { + return null; + } + if (breadcrumb.category === "redux.action") { + if ( + breadcrumb.data && + breadcrumb.data.type === "SET_EVALUATED_TREE" + ) { + breadcrumb.data = undefined; + } + } + return breadcrumb; + }, + }); } if (appsmithConfigs.smartLook.enabled) { From e0ac6e98509fafa8786532c2855ecccdebec0d29 Mon Sep 17 00:00:00 2001 From: Nikhil Nandagopal Date: Wed, 9 Dec 2020 11:59:40 +0530 Subject: [PATCH 2/3] Allowed console errors to still be logged --- app/client/src/utils/AppsmithUtils.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/src/utils/AppsmithUtils.tsx b/app/client/src/utils/AppsmithUtils.tsx index 9b5ddfdd2e..7863999fc7 100644 --- a/app/client/src/utils/AppsmithUtils.tsx +++ b/app/client/src/utils/AppsmithUtils.tsx @@ -49,7 +49,7 @@ export const appInitializer = () => { Sentry.init({ ...appsmithConfigs.sentry, beforeBreadcrumb(breadcrumb, hint) { - if (breadcrumb.category === "console") { + if (breadcrumb.category === "console" && breadcrumb.level !== "error") { return null; } if (breadcrumb.category === "redux.action") { From 0fc5817caa995d93c0d8493aa5755e7f83bf5c3e Mon Sep 17 00:00:00 2001 From: Nikhil Nandagopal Date: Wed, 9 Dec 2020 12:32:27 +0530 Subject: [PATCH 3/3] added a check for errors without payloads --- app/client/src/sagas/ErrorSagas.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/client/src/sagas/ErrorSagas.tsx b/app/client/src/sagas/ErrorSagas.tsx index a680b79316..5382365ec2 100644 --- a/app/client/src/sagas/ErrorSagas.tsx +++ b/app/client/src/sagas/ErrorSagas.tsx @@ -87,7 +87,7 @@ export function* errorSaga( // Just a pass through for now. // Add procedures to customize errors here log.debug(`Error in action ${errorAction.type}`); - log.error(errorAction.payload.error); + if (errorAction.payload) log.error(errorAction.payload.error); // Show a toast when the error occurs const { type, @@ -105,7 +105,7 @@ export function* errorSaga( yield put({ type: ReduxActionTypes.REPORT_ERROR, payload: { - message: errorAction.payload.error, + message: errorAction.payload ? errorAction.payload.error : undefined, source: errorAction.type, }, });