From 48840b09ec0a4af85f24b822869e17d0c99b61b6 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Fri, 12 Nov 2021 09:32:26 -0500 Subject: [PATCH 1/2] fix: add check to suppress retry log --- lib/providers/json-rpc-provider.js | 4 +++- lib/wallet-account.js | 2 ++ src/providers/json-rpc-provider.ts | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/providers/json-rpc-provider.js b/lib/providers/json-rpc-provider.js index c480f2a37d..b887052a26 100644 --- a/lib/providers/json-rpc-provider.js +++ b/lib/providers/json-rpc-provider.js @@ -327,7 +327,9 @@ class JsonRpcProvider extends provider_1.Provider { } catch (error) { if (error.type === 'TimeoutError') { - console.warn(`Retrying request to ${method} as it has timed out`, params); + if (!process.env["NEAR_NO_LOGS"]) { + console.warn(`Retrying request to ${method} as it has timed out`, params); + } return null; } throw error; diff --git a/lib/wallet-account.js b/lib/wallet-account.js index 79d79aee32..fc53ae1583 100644 --- a/lib/wallet-account.js +++ b/lib/wallet-account.js @@ -164,6 +164,8 @@ class WalletConnection { currentUrl.searchParams.delete('public_key'); currentUrl.searchParams.delete('all_keys'); currentUrl.searchParams.delete('account_id'); + currentUrl.searchParams.delete('meta'); + currentUrl.searchParams.delete('transactionHashes'); window.history.replaceState({}, document.title, currentUrl.toString()); } /** diff --git a/src/providers/json-rpc-provider.ts b/src/providers/json-rpc-provider.ts index 85a9ce8d97..f96c846319 100644 --- a/src/providers/json-rpc-provider.ts +++ b/src/providers/json-rpc-provider.ts @@ -373,7 +373,9 @@ export class JsonRpcProvider extends Provider { return response; } catch (error) { if (error.type === 'TimeoutError') { + if (!process.env["NEAR_NO_LOGS"]){ console.warn(`Retrying request to ${method} as it has timed out`, params); + } return null; } From 3bb02980115d7e88671e49dcb3209fedbdc814b6 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 15 Nov 2021 13:39:05 -0500 Subject: [PATCH 2/2] fix(fmt) --- lib/providers/json-rpc-provider.js | 2 +- src/providers/json-rpc-provider.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/providers/json-rpc-provider.js b/lib/providers/json-rpc-provider.js index b887052a26..09c141b1c5 100644 --- a/lib/providers/json-rpc-provider.js +++ b/lib/providers/json-rpc-provider.js @@ -327,7 +327,7 @@ class JsonRpcProvider extends provider_1.Provider { } catch (error) { if (error.type === 'TimeoutError') { - if (!process.env["NEAR_NO_LOGS"]) { + if (!process.env['NEAR_NO_LOGS']) { console.warn(`Retrying request to ${method} as it has timed out`, params); } return null; diff --git a/src/providers/json-rpc-provider.ts b/src/providers/json-rpc-provider.ts index f96c846319..bd47082fd2 100644 --- a/src/providers/json-rpc-provider.ts +++ b/src/providers/json-rpc-provider.ts @@ -373,9 +373,9 @@ export class JsonRpcProvider extends Provider { return response; } catch (error) { if (error.type === 'TimeoutError') { - if (!process.env["NEAR_NO_LOGS"]){ - console.warn(`Retrying request to ${method} as it has timed out`, params); - } + if (!process.env['NEAR_NO_LOGS']){ + console.warn(`Retrying request to ${method} as it has timed out`, params); + } return null; }