diff --git a/RELEASE b/RELEASE index dd57250646b..f7e8905950f 100644 --- a/RELEASE +++ b/RELEASE @@ -1,6 +1,6 @@ IPFS hash of the deployment: -- CIDv0: `QmbPRyz7JxeDFrkmKzQnSi5h8Vn5iP81skJA5SoXkfJb6G` -- CIDv1: `bafybeigb3zegvo3fwadtcskq6ty2fbznvkqu7jkxt56dequcbqenjo5kme` +- CIDv0: `QmSSKD7h4Q9E4bEtFW5zqeBJQ419v7BGHUushs7Myz2WQQ` +- CIDv1: `bafybeib44ixryspegordbiauzjcek6nvu4kqbdgucj6dgvwiv4jad6owde` The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org). @@ -10,15 +10,15 @@ You can also access the Uniswap Interface from an IPFS gateway. Your Uniswap settings are never remembered across different URLs. IPFS gateways: -- https://bafybeigb3zegvo3fwadtcskq6ty2fbznvkqu7jkxt56dequcbqenjo5kme.ipfs.dweb.link/ -- https://bafybeigb3zegvo3fwadtcskq6ty2fbznvkqu7jkxt56dequcbqenjo5kme.ipfs.cf-ipfs.com/ -- [ipfs://QmbPRyz7JxeDFrkmKzQnSi5h8Vn5iP81skJA5SoXkfJb6G/](ipfs://QmbPRyz7JxeDFrkmKzQnSi5h8Vn5iP81skJA5SoXkfJb6G/) +- https://bafybeib44ixryspegordbiauzjcek6nvu4kqbdgucj6dgvwiv4jad6owde.ipfs.dweb.link/ +- https://bafybeib44ixryspegordbiauzjcek6nvu4kqbdgucj6dgvwiv4jad6owde.ipfs.cf-ipfs.com/ +- [ipfs://QmSSKD7h4Q9E4bEtFW5zqeBJQ419v7BGHUushs7Myz2WQQ/](ipfs://QmSSKD7h4Q9E4bEtFW5zqeBJQ419v7BGHUushs7Myz2WQQ/) -### 5.50.1 (2024-10-07) +### 5.50.2 (2024-10-09) ### Bug Fixes -* **web:** invalidate local activity cache for updates to transaction or signature state - prod (#12732) 74b24f2 +* **web:** log step and original error on web (#12826) 5d4bd4f diff --git a/VERSION b/VERSION index 521d7a88253..9a5d2a51a78 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -web/5.50.1 \ No newline at end of file +web/5.50.2 \ No newline at end of file diff --git a/apps/web/src/state/sagas/transactions/swapSaga.ts b/apps/web/src/state/sagas/transactions/swapSaga.ts index ec6f4a69383..e323d1de558 100644 --- a/apps/web/src/state/sagas/transactions/swapSaga.ts +++ b/apps/web/src/state/sagas/transactions/swapSaga.ts @@ -54,8 +54,10 @@ import { import { isClassic } from 'uniswap/src/features/transactions/swap/utils/routing' import { getClassicQuoteFromResponse } from 'uniswap/src/features/transactions/swap/utils/tradingApi' import { createSaga } from 'uniswap/src/utils/saga' +import { errorToString } from 'utilities/src/errors' import { percentFromFloat } from 'utilities/src/format/percent' import { logger } from 'utilities/src/logger/logger' +import { LoggerErrorContext } from 'utilities/src/logger/types' import { didUserReject } from 'utils/swapErrorToUserReadableMessage' interface HandleSwapStepParams extends Omit { @@ -206,9 +208,7 @@ function* classicSwap( } } catch (error) { const displayableError = getDisplayableError(error, step) - if (displayableError) { - logger.error(displayableError, { tags: { file: 'swapSaga', function: 'classicSwap' } }) - } + logSwapError(displayableError, { tags: { file: 'swapSaga', function: 'classicSwap' } }) onFailure(displayableError) return } @@ -256,9 +256,7 @@ function* uniswapXSwap( } } catch (error) { const displayableError = getDisplayableError(error, step) - if (displayableError) { - logger.error(displayableError, { tags: { file: 'swapSaga', function: 'uniswapXSwap' } }) - } + logSwapError(displayableError, { tags: { file: 'swapSaga', function: 'uniswapXSwap' } }) onFailure(displayableError) return } @@ -267,6 +265,21 @@ function* uniswapXSwap( yield* call(onSuccess) } +function logSwapError(error: TransactionError | undefined, captureContext: LoggerErrorContext) { + if (error instanceof TransactionStepFailedError) { + logger.error( + { + ...error, + step: JSON.stringify(error.step), + originalError: errorToString(error.originalError), + }, + captureContext, + ) + } else if (error) { + logger.error(error, captureContext) + } +} + function getDisplayableError(error: Error, step: TransactionStep): TransactionError | undefined { // If the user rejects a request, or it's a known interruption e.g. trade update, we handle gracefully / do not show error UI if (didUserReject(error) || error instanceof HandledTransactionInterrupt) { diff --git a/packages/uniswap/src/features/transactions/swap/utils/tradingApi.ts b/packages/uniswap/src/features/transactions/swap/utils/tradingApi.ts index 7c9cfcedf04..95542432760 100644 --- a/packages/uniswap/src/features/transactions/swap/utils/tradingApi.ts +++ b/packages/uniswap/src/features/transactions/swap/utils/tradingApi.ts @@ -327,19 +327,10 @@ export function validateTrade({ const inputsMatch = areAddressesEqual(currencyIn.wrapped.address, trade?.inputAmount.currency.wrapped.address) const outputsMatch = areAddressesEqual(currencyOut.wrapped.address, trade.outputAmount.currency.wrapped.address) - // TODO(MOB-3028): check if this logic needs any adjustments once we add UniswapX support. - // Verify the amount specified in the quote response matches the exact amount from input state - const exactAmountFromQuote = isClassicQuote(trade.quote?.quote) - ? exactCurrencyField === CurrencyField.INPUT - ? trade.quote.quote.input?.amount - : trade.quote.quote.output?.amount - : undefined - const tokenAddressesMatch = inputsMatch && outputsMatch - const exactAmountsMatch = exactAmount?.toExact() !== exactAmountFromQuote - - if (!(tokenAddressesMatch && exactAmountsMatch)) { - logger.error(new Error(`Mismatched ${!tokenAddressesMatch ? 'address' : 'exact amount'} in swap trade`), { + // TODO(WEB-5132): Add validation checking that exact amount from response matches exact amount from user input + if (!tokenAddressesMatch) { + logger.error(new Error(`Mismatched address in swap trade`), { tags: { file: 'tradingApi/utils', function: 'validateTrade' }, extra: { formState: {