From e20c903a5b11c1d4c93e4bae60b043219e06775d Mon Sep 17 00:00:00 2001 From: Kathy Luo Date: Fri, 27 Sep 2024 16:01:53 +0200 Subject: [PATCH 1/2] chore: update redux logger, analytics, remote config logs to reduce noise --- src/analytics/AppAnalytics.ts | 6 +++++- src/firebase/firebase.ts | 2 -- src/redux/sagas.ts | 32 ++++++++++++++++++++++++++------ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/analytics/AppAnalytics.ts b/src/analytics/AppAnalytics.ts index f529486d1b6..b8b8788c580 100644 --- a/src/analytics/AppAnalytics.ts +++ b/src/analytics/AppAnalytics.ts @@ -203,7 +203,11 @@ class AppAnalytics { ...eventProperties, } - Logger.info(TAG, `Tracking event ${eventName} with properties:`, props) + if (__DEV__) { + Logger.debug(TAG, `Tracking event ${eventName} with properties:`, props) + } else { + Logger.info(TAG, `Tracking event ${eventName}`) + } this.segmentClient.track(eventName, props).catch((err) => { Logger.error(TAG, `Failed to track event ${eventName}`, err) diff --git a/src/firebase/firebase.ts b/src/firebase/firebase.ts index 205a1920b0e..8b2190f201c 100644 --- a/src/firebase/firebase.ts +++ b/src/firebase/firebase.ts @@ -265,8 +265,6 @@ export async function fetchRemoteConfigValues(): Promise { if ( action?.type && - (action.type.includes('IDENTITY/') || loggerBlocklist.includes(action.type)) + (action.type.includes('IDENTITY/') || loggerPayloadBlocklist.includes(action.type)) ) { - // Log only action type, but not the payload as it can have - // sensitive information. Excluding all IDENTITY/ actions because high likelyhood - // they contain PII and the blocklist may get out of date. + // Log only action type, but not the payload as it can have sensitive + // information or information that is not helpful for debugging. Excluding + // all IDENTITY/ actions because high likelyhood they contain PII and the + // blocklist may get out of date. Logger.debug('redux/saga@logger', `${action.type} (payload not logged)`) return } From b8f4fc4fe17fbe751cbcc3dc8414831403c2f18d Mon Sep 17 00:00:00 2001 From: Kathy Luo Date: Mon, 30 Sep 2024 11:40:58 +0200 Subject: [PATCH 2/2] Update src/redux/sagas.ts Co-authored-by: Jean Regisser --- src/redux/sagas.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/redux/sagas.ts b/src/redux/sagas.ts index ca3ece3728b..b72bec6e68a 100644 --- a/src/redux/sagas.ts +++ b/src/redux/sagas.ts @@ -63,13 +63,13 @@ const loggerPayloadBlocklist = [ setPhoneRecipientCache.toString(), updateAppRecipientCache.toString(), TransactionActions.UPDATE_TRANSACTIONS, - setTokenBalances.toString(), - fetchPriceHistorySuccess.toString(), - rewardsSendersFetched.toString(), - fetchDappsListCompleted.toString(), - fetchNftsCompleted.toString(), - fetchPositionsSuccess.toString(), - fetchShortcutsSuccess.toString(), + setTokenBalances.type, + fetchPriceHistorySuccess.type, + rewardsSendersFetched.type, + fetchDappsListCompleted.type, + fetchNftsCompleted.type, + fetchPositionsSuccess.type, + fetchShortcutsSuccess.type, AppActions.UPDATE_REMOTE_CONFIG_VALUES, ]