From 1d59f92a699bf21601f66a07e790f633689a5572 Mon Sep 17 00:00:00 2001 From: Uniswap Labs Service Account Date: Thu, 13 Jun 2024 19:15:16 +0000 Subject: [PATCH] ci(release): publish latest release --- RELEASE | 70 ++----------------- VERSION | 2 +- .../MiniPortfolio/Activity/parseRemote.tsx | 7 +- .../MiniPortfolio/Activity/utils.ts | 18 ++--- .../MiniPortfolio/Pools/getTokensAsync.ts | 12 +--- .../Pools/useMultiChainPositions.tsx | 14 ++-- apps/web/src/hooks/useConfirmModalState.ts | 7 +- apps/web/src/hooks/useConnect.tsx | 10 +-- apps/web/src/hooks/useContract.ts | 22 ++---- apps/web/src/hooks/useFetchListCallback.ts | 10 +-- apps/web/src/hooks/useSwapTaxes.ts | 2 +- apps/web/src/hooks/useSwitchChain.ts | 5 +- apps/web/src/hooks/useUniversalRouter.ts | 10 +-- apps/web/src/hooks/useWrapCallback.tsx | 7 +- apps/web/src/lib/hooks/useApproval.ts | 19 ++--- apps/web/src/rpc/AppJsonRpcProvider.ts | 2 +- apps/web/src/state/activity/polling/orders.ts | 2 +- apps/web/src/state/application/hooks.ts | 7 +- apps/web/src/state/claim/hooks.ts | 15 +--- apps/web/src/state/lists/hooks.ts | 7 +- apps/web/src/state/logs/updater.ts | 8 +-- apps/web/src/state/mint/hooks.tsx | 11 ++- apps/web/src/state/routing/utils.ts | 7 +- apps/web/src/state/stake/hooks.tsx | 7 +- apps/web/src/utils/serviceWorker.ts | 7 +- apps/web/src/utils/signing.ts | 2 +- .../utils/swapErrorToUserReadableMessage.tsx | 13 ++-- 27 files changed, 67 insertions(+), 236 deletions(-) diff --git a/RELEASE b/RELEASE index 6687287169e..879825b82ba 100644 --- a/RELEASE +++ b/RELEASE @@ -1,6 +1,6 @@ IPFS hash of the deployment: -- CIDv0: `QmQ2oCvxsKb6KLE7XeR4ppyZWhiAsEAMwtXta9Gwtvptnx` -- CIDv1: `bafybeiazesdn7jujaopqkz3nwemsmtbdp4fcxvjv75cevqgm3fhe65nwdu` +- CIDv0: `QmU2prusDiAfiySsHU8tcVbFwcrvSXdEDBVbvyzkpYKEUH` +- CIDv1: `bafybeicususuyvytbxxpmjbk7ustwesnzwekzn4fs3argdhmr3d3p2t2mi` The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org). @@ -10,68 +10,10 @@ You can also access the Uniswap Interface from an IPFS gateway. Your Uniswap settings are never remembered across different URLs. IPFS gateways: -- https://bafybeiazesdn7jujaopqkz3nwemsmtbdp4fcxvjv75cevqgm3fhe65nwdu.ipfs.dweb.link/ -- https://bafybeiazesdn7jujaopqkz3nwemsmtbdp4fcxvjv75cevqgm3fhe65nwdu.ipfs.cf-ipfs.com/ -- [ipfs://QmQ2oCvxsKb6KLE7XeR4ppyZWhiAsEAMwtXta9Gwtvptnx/](ipfs://QmQ2oCvxsKb6KLE7XeR4ppyZWhiAsEAMwtXta9Gwtvptnx/) +- https://bafybeicususuyvytbxxpmjbk7ustwesnzwekzn4fs3argdhmr3d3p2t2mi.ipfs.dweb.link/ +- https://bafybeicususuyvytbxxpmjbk7ustwesnzwekzn4fs3argdhmr3d3p2t2mi.ipfs.cf-ipfs.com/ +- [ipfs://QmU2prusDiAfiySsHU8tcVbFwcrvSXdEDBVbvyzkpYKEUH/](ipfs://QmU2prusDiAfiySsHU8tcVbFwcrvSXdEDBVbvyzkpYKEUH/) -## 5.34.0 (2024-06-12) - - -### Features - -* **web:** [multichain] 4070 add chain approval to swap execution flow (#8284) f645d37 -* **web:** [multichain] 4101 update chain id in swap and limit context (#8363) 83cf952 -* **web:** [multichain] 4121 add switch chain to send execution flow (#8060) a40162b -* **web:** [multichain] 4127 fallback to gql (token balances) when chain is not synced (#8059) 9848242 -* **web:** 4194 use correct native currency in send (#8446) dbff9f3 -* **web:** 4194 use correct native currency in swap (#8448) 27a34cd -* **web:** 4250 - add UniverseChainInfo and UniverseChainId types (#8632) 5c6208a -* **web:** 4250 - create UNIVERSE_CHAIN_INFO and mainnet property (#8633) db60dc7 -* **web:** 4250 - move RPCType and DEFAULT_NATIVE_ADDRESS to uniswap pkg (#8634) f578d39 -* **web:** 4250 - pull all chain info from universe (#8643) d76fbf2 -* **web:** 4250 - use mainnet from UniverseChainInfo on wallet (#8636) 2161df6 -* **web:** 4250 - use mainnet from UniverseChainInfo on web (#8635) 2864084 -* **web:** Add base to supported moonpay chains (#8805) d06d5cb -* **web:** add infringing LV nft collections (#8719) 095e89c -* **web:** Add Moonpay deeplink (#8806) 81e6971 -* **web:** add quoteId to Xv2 rfq POST (#8909) 54a936b -* **web:** add unauthenticated FOR transaction fetcher to uniswap package (#8587) 3a6ccfe -* **web:** adding zora (#8711) e99544c -* **web:** FOR - share token picker button (#8741) 3048ad2 -* **web:** migrate off direct console logging (#8334) e5f9873 -* **web:** move basic sharable ForAggregator API calls to uniswap package (#8553) fa54d49 -* **web:** move Pill component to shared uniswap package (#8701) 4806ede -* **web:** Refreshed nav "Get Started" modal (#8642) 6a0e15d -* **web:** Refreshed nav better app layout (#8625) 4b23b54 -* **web:** Refreshed nav chain selector dropdown (#8627) b5d092c -* **web:** Refreshed nav company menu dropdown (#8641) b7b2244 -* **web:** Refreshed nav preferences menu and theme toggle (#8628) 9d43d7d -* **web:** Refreshed nav prep work, organize files (#8622) 9c8b5f7 -* **web:** Replace direct thegraph queries with new BE queries (#8626) 5081b54 -* **web:** share country picker component for FOR (#8702) 3800c04 - - -### Bug Fixes - -* **web:** [multichain] token selector in TDP should use connected chain (#8963) 6ef7dbc -* **web:** AccountDrawer still showing in in-app browser on scroll when closed (#8623) ae322cb -* **web:** can't switch to mainnet if first pageload has chain query param (#8684) d2e3bfb -* **web:** connector may be undefined on landing page (#8822) 9323bd4 -* **web:** dialog button should no longer be disabled (#8849) 56285db -* **web:** don't disable swap settings for unconnected chains (#8651) 141b089 -* **web:** fix missing translation, despite matching the library doesnt work with fee.bestForStable (#8629) 9470c59 -* **web:** liquidity translations (#8821) 4744be8 -* **web:** Pass account to send in transferInfo - staging (#8902) 786dead -* **web:** patch wagmi to fix MM bug (#8841) 834a26c -* **web:** Remove duplicate app promo banners (#8646) b35c3c1 -* **web:** removing zora from network selector when feature flag is off (#8960) e1eb12d -* **web:** update useOnClickOutside to handle tooltips (#8704) 3697c7e -* **web:** use address, chainId, from useAccount instead of web3-react (#8513) 26bc9fb -* **web:** use orders text in CancelLimitDialog (#8706) 3fb4151 - - -### Continuous Integration - -* **web:** update sitemaps f972a73 +### 5.34.1 (2024-06-13) diff --git a/VERSION b/VERSION index 4c1a01aed96..283881d6966 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -web/5.34.0 \ No newline at end of file +web/5.34.1 \ No newline at end of file diff --git a/apps/web/src/components/AccountDrawer/MiniPortfolio/Activity/parseRemote.tsx b/apps/web/src/components/AccountDrawer/MiniPortfolio/Activity/parseRemote.tsx index 4d36b2435fd..4f45ae28234 100644 --- a/apps/web/src/components/AccountDrawer/MiniPortfolio/Activity/parseRemote.tsx +++ b/apps/web/src/components/AccountDrawer/MiniPortfolio/Activity/parseRemote.tsx @@ -561,11 +561,8 @@ function parseRemoteActivity( ) return { ...defaultFields, ...parsedFields } } catch (e) { - logger.error(e, { - tags: { - file: 'parseRemote', - function: 'parseRemoteActivity', - }, + logger.debug('parseRemote', 'parseRemoteActivity', 'Failed to parse remote activity', { + error: e, extra: { assetActivity }, }) return undefined diff --git a/apps/web/src/components/AccountDrawer/MiniPortfolio/Activity/utils.ts b/apps/web/src/components/AccountDrawer/MiniPortfolio/Activity/utils.ts index fae9f889854..7544c66131a 100644 --- a/apps/web/src/components/AccountDrawer/MiniPortfolio/Activity/utils.ts +++ b/apps/web/src/components/AccountDrawer/MiniPortfolio/Activity/utils.ts @@ -201,12 +201,7 @@ async function cancelMultipleUniswapXOrders({ return transactions } catch (error) { if (!didUserReject(error)) { - logger.error(error, { - tags: { - file: 'utils', - function: 'cancelMultipleUniswapXOrders', - }, - }) + logger.debug('utils', 'cancelMultipleUniswapXOrders', 'Failed to cancel multiple orders', { error, orders }) } return undefined } @@ -228,13 +223,10 @@ async function getCancelMultipleUniswapXOrdersTransaction( chainId, } } catch (error) { - const wrappedError = new Error('could not populate cancel transaction') - wrappedError.cause = error - logger.error(wrappedError, { - tags: { - file: 'utils', - function: 'getCancelMultipleUniswapXOrdersTransaction', - }, + const wrappedError = new Error('could not populate cancel transaction', { cause: error }) + logger.debug('utils', 'getCancelMultipleUniswapXOrdersTransaction', wrappedError.message, { + error: wrappedError, + orders, }) return undefined } diff --git a/apps/web/src/components/AccountDrawer/MiniPortfolio/Pools/getTokensAsync.ts b/apps/web/src/components/AccountDrawer/MiniPortfolio/Pools/getTokensAsync.ts index 99df7223b7b..f6afb482913 100644 --- a/apps/web/src/components/AccountDrawer/MiniPortfolio/Pools/getTokensAsync.ts +++ b/apps/web/src/components/AccountDrawer/MiniPortfolio/Pools/getTokensAsync.ts @@ -33,9 +33,7 @@ async function fetchChunk(multicall: UniswapInterfaceMulticall, chunk: Call[]): ]).then(([c0, c1]) => [...c0, ...c1]) } } - logger.error(error, { - tags: { file: 'getTokensAsync', function: 'fetchChunk' }, - }) + logger.debug('getTokensAsync', 'fetchChunk', 'Error fetching chunk', { error, extra: { chunk } }) throw error } } @@ -58,13 +56,7 @@ function tryParseToken(address: string, chainId: ChainId, data: CallResult[]) { return new Token(chainId, address, decimals, symbol, name) } catch (error) { - logger.error(error, { - tags: { - file: 'getTokensAsync', - function: 'tryParseToken', - }, - extra: { address, chainId }, - }) + logger.debug('getTokensAsync', 'tryParseToken', 'Failed to parse token', { error, address, chainId }) return undefined } } diff --git a/apps/web/src/components/AccountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx b/apps/web/src/components/AccountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx index d0b4e12a9b3..d83a53d11b1 100644 --- a/apps/web/src/components/AccountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx +++ b/apps/web/src/components/AccountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx @@ -144,7 +144,7 @@ export default function useMultiChainPositions(account: string, chains = DEFAULT const slot0 = poolInterface.decodeFunctionResult('slot0', result.returnData) acc.push(createPositionInfo(account, chainId, positionDetails[i], slot0, ...poolPairs[i])) } else { - logger.warn('useMultiChainPositions', 'fetchPositionInfo', 'slot0 fetch errored', result) + logger.debug('useMultiChainPositions', 'fetchPositionInfo', 'slot0 fetch errored', result) } return acc }, []) @@ -172,14 +172,10 @@ export default function useMultiChainPositions(account: string, chains = DEFAULT const postionDetails = await fetchPositionDetails(pm, positionIds) return fetchPositionInfo(postionDetails, chainId, multicall) } catch (error) { - const wrappedError = new Error('Failed to fetch positions for chain') - wrappedError.cause = error - logger.error(wrappedError, { - tags: { - file: 'useMultiChainPositions', - function: 'fetchPositionsForChain', - }, - extra: { chainId }, + const wrappedError = new Error('Failed to fetch positions for chain', { cause: error }) + logger.debug('useMultiChainPositions', 'fetchPositionsForChain', wrappedError.message, { + error: wrappedError, + chainId, }) return [] } diff --git a/apps/web/src/hooks/useConfirmModalState.ts b/apps/web/src/hooks/useConfirmModalState.ts index 6981eb9792b..c61ed25e7b3 100644 --- a/apps/web/src/hooks/useConfirmModalState.ts +++ b/apps/web/src/hooks/useConfirmModalState.ts @@ -99,12 +99,7 @@ export function useConfirmModalState({ if (didUserReject(e)) { return } - logger.error(e, { - tags: { - file: 'useConfirmModalState', - function: 'useConfirmModalState', - }, - }) + logger.warn('useConfirmModalState', 'catchUserReject', 'Failed to wrap', { error: e, trade }) setApprovalError(errorType) } diff --git a/apps/web/src/hooks/useConnect.tsx b/apps/web/src/hooks/useConnect.tsx index a76a04e803a..6d43ca74e46 100644 --- a/apps/web/src/hooks/useConnect.tsx +++ b/apps/web/src/hooks/useConnect.tsx @@ -32,15 +32,7 @@ export function ConnectionProvider({ children }: PropsWithChildren) { } // TODO(WEB-1859): re-add special treatment for already-pending injected errors & move debug to after didUserReject() check - logger.error(error, { - tags: { - file: 'useConnect', - function: 'ConnectionProvider', - }, - extra: { - connector: connector.name, - }, - }) + logger.warn('useConnect', 'ConnectionProvider', `Connection failed: ${connector.name}`) sendAnalyticsEvent(InterfaceEventName.WALLET_CONNECTED, { result: WalletConnectionResult.FAILED, diff --git a/apps/web/src/hooks/useContract.ts b/apps/web/src/hooks/useContract.ts index 95aea0c00f2..a5d8f6ab808 100644 --- a/apps/web/src/hooks/useContract.ts +++ b/apps/web/src/hooks/useContract.ts @@ -74,13 +74,11 @@ export function useContract( try { return getContract(address, ABI, provider, withSignerIfPossible && account.address ? account.address : undefined) } catch (error) { - const wrappedError = new Error('failed to get contract') - wrappedError.cause = error - logger.error(wrappedError, { - tags: { - file: 'useContract', - function: 'useContract', - }, + const wrappedError = new Error('failed to get contract', { cause: error }) + logger.warn('useContract', 'useContract', wrappedError.message, { + error: wrappedError, + addressOrAddressMap, + address: account.address, }) return null } @@ -103,14 +101,8 @@ function useMainnetContract(address: string | und try { return getContract(address, ABI, provider) } catch (error) { - const wrappedError = new Error('failed to get mainnet contract') - wrappedError.cause = error - logger.error(wrappedError, { - tags: { - file: 'useContract', - function: 'useMainnetContract', - }, - }) + const wrappedError = new Error('failed to get mainnet contract', { cause: error }) + logger.warn('useContract', 'useMainnetContract', wrappedError.message, wrappedError) return null } }, [isMainnet, contract, address, ABI]) as T diff --git a/apps/web/src/hooks/useFetchListCallback.ts b/apps/web/src/hooks/useFetchListCallback.ts index 876efaaa8f9..f59971a803a 100644 --- a/apps/web/src/hooks/useFetchListCallback.ts +++ b/apps/web/src/hooks/useFetchListCallback.ts @@ -26,15 +26,7 @@ export function useFetchListCallback(): (listUrl: string, skipValidation?: boole return tokenList }) .catch((error) => { - logger.error(error, { - tags: { - file: 'useFetchListCallback', - function: 'useFetchListCallback', - }, - extra: { - listUrl, - }, - }) + logger.debug('useFetchListCallback', 'useFetchListCallback', 'Failed to fetch list', { error, listUrl }) dispatch(fetchTokenList.rejected({ url: listUrl, requestId, errorMessage: error.message })) throw error }) diff --git a/apps/web/src/hooks/useSwapTaxes.ts b/apps/web/src/hooks/useSwapTaxes.ts index 5ed0b9eb321..bcbdc1bd5b2 100644 --- a/apps/web/src/hooks/useSwapTaxes.ts +++ b/apps/web/src/hooks/useSwapTaxes.ts @@ -84,7 +84,7 @@ async function getSwapTaxes( }) } } catch (e) { - logger.debug('useSwapTaxes', 'getSwapTaxes', 'Failed to get swap taxes for token(s):', addresses, e) + logger.warn('useSwapTaxes', 'getSwapTaxes', 'Failed to get swap taxes for token(s):', addresses, e) } const inputTax = (inputTokenAddress ? FEE_CACHE[inputTokenAddress]?.sellTax : ZERO_PERCENT) ?? ZERO_PERCENT diff --git a/apps/web/src/hooks/useSwitchChain.ts b/apps/web/src/hooks/useSwitchChain.ts index 796c1b8cf4f..4ccda95050b 100644 --- a/apps/web/src/hooks/useSwitchChain.ts +++ b/apps/web/src/hooks/useSwitchChain.ts @@ -48,7 +48,10 @@ export function useSwitchChain() { setSearchParams(searchParams, { replace: true }) } } catch (error) { - logger.warn('useSwitchChain', 'useSwitchChain', 'Failed to set SearchParams', error) + logger.warn('useSwitchChain', 'useSwitchChain', 'Failed to set SearchParams', { + error, + searchParams, + }) } }, onSettled(_, error) { diff --git a/apps/web/src/hooks/useUniversalRouter.ts b/apps/web/src/hooks/useUniversalRouter.ts index 060fc33d191..b3559932539 100644 --- a/apps/web/src/hooks/useUniversalRouter.ts +++ b/apps/web/src/hooks/useUniversalRouter.ts @@ -113,14 +113,8 @@ export function useUniversalRouterSwapCallback( txRequest: tx, isAutoSlippage, }) - const wrappedError = new Error('gas error') - wrappedError.cause = gasError - logger.error(wrappedError, { - tags: { - file: 'useUniversalRouter', - function: 'useUniversalRouterSwapCallback', - }, - }) + const wrappedError = new Error('gas error', { cause: gasError }) + logger.warn('useUniversalRouter', 'useUniversalRouterSwapCallback', 'Failed to estimate gas', wrappedError) throw new GasEstimationError() } diff --git a/apps/web/src/hooks/useWrapCallback.tsx b/apps/web/src/hooks/useWrapCallback.tsx index af07313b873..96a3d35e54e 100644 --- a/apps/web/src/hooks/useWrapCallback.tsx +++ b/apps/web/src/hooks/useWrapCallback.tsx @@ -164,12 +164,7 @@ Please file a bug detailing how this happened - https://github.com/Uniswap/inter }) return txReceipt.hash } catch (error) { - logger.error(error, { - tags: { - file: 'useWrapCallback', - function: 'useWrapCallback', - }, - }) + logger.warn('useWrapCallback', 'useWrapCallback', 'Failed to wrap', error) throw error } }) diff --git a/apps/web/src/lib/hooks/useApproval.ts b/apps/web/src/lib/hooks/useApproval.ts index 450be79666c..3536686efeb 100644 --- a/apps/web/src/lib/hooks/useApproval.ts +++ b/apps/web/src/lib/hooks/useApproval.ts @@ -72,19 +72,14 @@ export function useApproval( const approve = useCallback(async () => { function logFailure(error: Error | string): undefined { if (typeof error === 'string') { - logger.warn('useApproval', 'approve', error) + logger.debug('useApproval', 'approve', error) } else { - logger.error(error, { - tags: { - file: 'useApproval', - function: 'approve', - }, - extra: { - tokenChain: token?.chainId, - token: token?.address, - chainId, - amountToApprove: amountToApprove?.toFixed(), - }, + logger.debug('useApproval', 'approve', 'Failed to approve amount', { + error, + tokenChain: token?.chainId, + token: token?.address, + chainId, + amountToApprove: amountToApprove?.toFixed(), }) } diff --git a/apps/web/src/rpc/AppJsonRpcProvider.ts b/apps/web/src/rpc/AppJsonRpcProvider.ts index d0a3f030867..b3817a34dcc 100644 --- a/apps/web/src/rpc/AppJsonRpcProvider.ts +++ b/apps/web/src/rpc/AppJsonRpcProvider.ts @@ -85,7 +85,7 @@ export default class AppJsonRpcProvider extends ConfiguredJsonRpcProvider { controller.onSuccess() return result } catch (error) { - logger.debug('AppJsonRpcProvider', 'perform', 'rpc action failed', error) + logger.warn('AppJsonRpcProvider', 'perform', 'rpc action failed', error) controller.onError() } } diff --git a/apps/web/src/state/activity/polling/orders.ts b/apps/web/src/state/activity/polling/orders.ts index e075547c69d..bb07ae81ba1 100644 --- a/apps/web/src/state/activity/polling/orders.ts +++ b/apps/web/src/state/activity/polling/orders.ts @@ -116,7 +116,7 @@ export function usePollPendingOrders(onActivityUpdate: OnActivityUpdate) { }) }) } catch (e) { - logger.debug('orders', 'usePollPendingOrders', e) + logger.debug('usePollPendingOrders', 'getOrderStatuses', 'Failed to fetch order statuses', e) } setCurrentDelay((currentDelay) => Math.min(currentDelay * 2, ms('30s'))) timeout = setTimeout(getOrderStatuses, currentDelay) diff --git a/apps/web/src/state/application/hooks.ts b/apps/web/src/state/application/hooks.ts index 3e0ec192c60..ae5244861e3 100644 --- a/apps/web/src/state/application/hooks.ts +++ b/apps/web/src/state/application/hooks.ts @@ -65,12 +65,7 @@ export function useFiatOnrampAvailability(shouldCheck: boolean, callback?: () => callback() } } catch (e) { - logger.error(e, { - tags: { - file: 'application/hooks', - function: 'useFiatOnrampAvailability', - }, - }) + logger.warn('useFiatOnrampAvailability', 'checkAvailability', 'Error fetching FOR availability', e) if (stale) { return } diff --git a/apps/web/src/state/claim/hooks.ts b/apps/web/src/state/claim/hooks.ts index 18d897b586d..cb5b6e10b11 100644 --- a/apps/web/src/state/claim/hooks.ts +++ b/apps/web/src/state/claim/hooks.ts @@ -40,12 +40,7 @@ function fetchClaimMapping(): Promise { ) .then((res) => res.json()) .catch((error) => { - logger.error(error, { - tags: { - file: 'claim/hooks', - function: 'fetchClaimMapping', - }, - }) + logger.warn('claim/hooks', 'fetchClaimMapping', 'Claim mapping fetch failed', error) FETCH_CLAIM_MAPPING_PROMISE = null })) ) @@ -60,13 +55,7 @@ function fetchClaimFile(key: string): Promise<{ [address: string]: UserClaimData ) .then((res) => res.json()) .catch((error) => { - logger.error(error, { - tags: { - file: 'claim/hooks', - function: 'fetchClaimFile', - }, - extra: { address: key }, - }) + logger.warn('claim/hooks', 'fetchClaimFile', 'Claim file fetch failed', error) delete FETCH_CLAIM_FILE_PROMISES[key] })) ) diff --git a/apps/web/src/state/lists/hooks.ts b/apps/web/src/state/lists/hooks.ts index 2cd28e0bbf4..6d089456372 100644 --- a/apps/web/src/state/lists/hooks.ts +++ b/apps/web/src/state/lists/hooks.ts @@ -53,12 +53,7 @@ function useCombinedTokenMapFromUrls(urls: string[] | undefined): TokenAddressMa try { return combineMaps(allTokens, tokensToChainTokenMap(current)) } catch (error) { - logger.error(error, { - tags: { - file: 'lists/hooks', - function: 'useCombinedTokenMapFromUrls', - }, - }) + logger.warn('lists/hooks', 'useCombinedTokenMapFromUrls', 'Failed to combine tokens', error) return allTokens } }, {}) diff --git a/apps/web/src/state/logs/updater.ts b/apps/web/src/state/logs/updater.ts index 1643d951466..7ee69c5ede9 100644 --- a/apps/web/src/state/logs/updater.ts +++ b/apps/web/src/state/logs/updater.ts @@ -79,13 +79,7 @@ export default function Updater(): null { ) }) .catch((error) => { - logger.error(error, { - tags: { - file: 'logs/updater', - function: 'Updater#useEffect', - }, - extra: { filter }, - }) + logger.warn('logs/updater', 'Updater#useEffect', 'Failed to fetch logs', { error, filter }) dispatch( fetchedLogsError({ chainId, diff --git a/apps/web/src/state/mint/hooks.tsx b/apps/web/src/state/mint/hooks.tsx index f552f33770c..57f30365593 100644 --- a/apps/web/src/state/mint/hooks.tsx +++ b/apps/web/src/state/mint/hooks.tsx @@ -160,14 +160,11 @@ export function useDerivedMintInfo( try { return pair.getLiquidityMinted(totalSupply, tokenAmountA, tokenAmountB) } catch (error) { - logger.error( + logger.warn( + 'mint/hooks', + 'useDerivedMintInfo', `Error getLiquidityMinted: ${error}. Total supply: ${totalSupply}, tokenAmountA: ${tokenAmountA}, tokenAmountB: ${tokenAmountB}`, - { - tags: { - file: 'mint/hooks', - function: 'useDerivedMintInfo', - }, - } + { error } ) return undefined } diff --git a/apps/web/src/state/routing/utils.ts b/apps/web/src/state/routing/utils.ts index 1bc781fb16e..a6b053a011b 100644 --- a/apps/web/src/state/routing/utils.ts +++ b/apps/web/src/state/routing/utils.ts @@ -89,12 +89,7 @@ export function computeRoutes(args: GetQuoteArgs, routes: ClassicQuoteData['rout } }) } catch (e) { - logger.error(e, { - tags: { - file: 'routing/utils', - function: 'computeRoutes', - }, - }) + logger.warn('routing/utils', 'computeRoutes', 'Failed to compute routes', { error: e }) return } } diff --git a/apps/web/src/state/stake/hooks.tsx b/apps/web/src/state/stake/hooks.tsx index 06074c70781..92605789c19 100644 --- a/apps/web/src/state/stake/hooks.tsx +++ b/apps/web/src/state/stake/hooks.tsx @@ -151,12 +151,7 @@ export function useStakingInfo(pairToFilterBy?: Pair | null): StakingInfo[] { rewardRateState.error || periodFinishState.error ) { - logger.error(new Error('Failed to load staking rewards info'), { - tags: { - file: 'stake/hooks', - function: 'useStakingInfo', - }, - }) + logger.warn('stake/hooks', 'useStakingInfo', 'Failed to load staking rewards info') return memo } diff --git a/apps/web/src/utils/serviceWorker.ts b/apps/web/src/utils/serviceWorker.ts index 50d8387a5aa..54fb15fcda1 100644 --- a/apps/web/src/utils/serviceWorker.ts +++ b/apps/web/src/utils/serviceWorker.ts @@ -7,12 +7,7 @@ export function unregister() { registration.unregister() }) .catch((error) => { - logger.error(error, { - tags: { - file: 'serviceWorker', - function: 'unregister', - }, - }) + logger.warn('serviceWorker', 'unregister', 'Service worker unregister failed', error) }) } } diff --git a/apps/web/src/utils/signing.ts b/apps/web/src/utils/signing.ts index 2229cf16338..bd79eb9a072 100644 --- a/apps/web/src/utils/signing.ts +++ b/apps/web/src/utils/signing.ts @@ -60,7 +60,7 @@ export async function signTypedData( 'signing', 'signTypedData', 'signTypedData: wallet does not implement EIP-712, falling back to eth_sign', - error.message + error ) const hash = _TypedDataEncoder.hash(populated.domain, types, populated.value) return await signer.provider.send('eth_sign', [address, hash]) diff --git a/apps/web/src/utils/swapErrorToUserReadableMessage.tsx b/apps/web/src/utils/swapErrorToUserReadableMessage.tsx index 00cd537ffab..d1720ff5e4b 100644 --- a/apps/web/src/utils/swapErrorToUserReadableMessage.tsx +++ b/apps/web/src/utils/swapErrorToUserReadableMessage.tsx @@ -71,13 +71,12 @@ export function swapErrorToUserReadableMessage(error: any): string { return t`The output token cannot be transferred. There may be an issue with the output token. Note: fee on transfer and rebase tokens are incompatible with Uniswap V3.` default: if (reason?.indexOf('undefined is not an object') !== -1) { - logger.error(error, { - tags: { - file: 'swapErrorToUserReadableMessage', - function: 'swapErrorToUserReadableMessage', - }, - extra: { reason }, - }) + logger.warn( + 'swapErrorToUserReadableMessage', + 'swapErrorToUserReadableMessage', + 'Undefined object error', + reason + ) return t`An error occurred when trying to execute this swap. You may need to increase your slippage tolerance. If that does not work, there may be an incompatibility with the token you are trading. Note: fee-on-transfer and rebase tokens are incompatible with Uniswap V3.` } return t(