From 0b89f5a9e8e36543825f73d3c664cd8bbc3f8d14 Mon Sep 17 00:00:00 2001 From: Matthew Lilley Date: Tue, 1 Oct 2024 05:46:22 +0100 Subject: [PATCH 1/2] chore: disable sentry telemetry --- apps/web/next.config.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 79317e75de..d118097122 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -132,4 +132,7 @@ export default withSentryConfig(nextConfig, { // https://docs.sentry.io/product/crons/ // https://vercel.com/docs/cron-jobs automaticVercelMonitors: true, + + // Disables Sentry's telemetry features + telemetry: false, }) From bf5c36a3d28309561cda1a5e7eda96bef57bf539 Mon Sep 17 00:00:00 2001 From: Matthew Lilley Date: Tue, 1 Oct 2024 06:33:00 +0100 Subject: [PATCH 2/2] chore: remove breadcrumbs --- apps/web/src/lib/hooks/useSimulateTrade.ts | 3 ++- .../simple-swap-trade-review-dialog.tsx | 25 +++---------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/apps/web/src/lib/hooks/useSimulateTrade.ts b/apps/web/src/lib/hooks/useSimulateTrade.ts index 1655901543..8340cb048b 100644 --- a/apps/web/src/lib/hooks/useSimulateTrade.ts +++ b/apps/web/src/lib/hooks/useSimulateTrade.ts @@ -42,8 +42,9 @@ export function useSimulateTrade({ trade && typeof trade.tokenTax === 'undefined' && isMinOutError(error) - ) + ) { return false + } return i < 3 }, enabled: diff --git a/apps/web/src/ui/swap/simple/simple-swap-trade-review-dialog.tsx b/apps/web/src/ui/swap/simple/simple-swap-trade-review-dialog.tsx index 03ec0471aa..d7b9fbe572 100644 --- a/apps/web/src/ui/swap/simple/simple-swap-trade-review-dialog.tsx +++ b/apps/web/src/ui/swap/simple/simple-swap-trade-review-dialog.tsx @@ -100,6 +100,7 @@ export const SimpleSwapTradeReviewDialog: FC<{ trade?.tokenTax instanceof Percent ? trade.tokenTax.toPercentageString() : trade?.tokenTax, + tx: trade.tx, }) }, [trade, chainId]) @@ -151,9 +152,8 @@ export const SimpleSwapTradeReviewDialog: FC<{ try { const ts = new Date().getTime() - const receiptPromise = client.waitForTransactionReceipt({ + const promise = client.waitForTransactionReceipt({ hash, - retryCount: 30, }) sendAnalyticsEvent(SwapEventName.SWAP_SIGNED, { @@ -167,7 +167,7 @@ export const SimpleSwapTradeReviewDialog: FC<{ type: 'swap', chainId: chainId, txHash: hash, - promise: receiptPromise, + promise, summary: { pending: `${ isWrap ? 'Wrapping' : isUnwrap ? 'Unwrapping' : 'Swapping' @@ -197,7 +197,7 @@ export const SimpleSwapTradeReviewDialog: FC<{ groupTimestamp: ts, }) - const receipt = await receiptPromise + const receipt = await promise { const trade = tradeRef.current if (receipt.status === 'success') { @@ -274,25 +274,9 @@ export const SimpleSwapTradeReviewDialog: FC<{ return async (confirm: () => void) => { try { - Sentry.addBreadcrumb({ - category: 'swap', - message: 'Swap execution in progress', - level: 'info', - }) await sendTransactionAsync(simulation) - // Add breadcrumb for successful swap - Sentry.addBreadcrumb({ - category: 'swap', - message: 'Swap completed successfully', - level: 'info', - }) confirm() } catch (e) { - Sentry.addBreadcrumb({ - category: 'swap', - message: 'Swap failed', - level: 'error', - }) Sentry.captureException(e) throw e } @@ -302,7 +286,6 @@ export const SimpleSwapTradeReviewDialog: FC<{ const { status } = useWaitForTransactionReceipt({ chainId: chainId, hash: data, - retryCount: 30, }) return (