Skip to content

Commit

Permalink
chore: add better analytics for broadcast errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed May 15, 2024
1 parent 9d2e33c commit dbe752f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,3 @@ export function BroadcastErrorDialog() {
</Dialog>
);
}
// thjis is where it fails so take a look here

/**
*
* I tried
* - send with low fee, custom fee, high fee
* - oull out ledger while confirming
* - try medium fee? look at sentry, l;ook at this error-dialog and what sends us here and when
*
*
* Rolled back to v6.31.0 and can’t find any .address
Barely even have any results for get(state, 'a
Nevermind .address
> Pete
*
*/

// FIRST fix routing tests https://github.com/leather-wallet/extension/actions/runs/9090696560/job/24983972564?pr=5353

// > try a few more things here then wrap up an investigation. I can't really see anythig happening here

// Then after that try and clean house with some short UI stuff

// - can I do network modal ?
// - can I do increase fee background location?
// - settings menu animations?
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import get from 'lodash.get';

import { RouteUrls } from '@shared/route-urls';
import { delay, isError } from '@shared/utils';
import { analytics } from '@shared/utils/analytics';

import { useScrollLock } from '@app/common/hooks/use-scroll-lock';
import { appEvents } from '@app/common/publish-subscribe';
Expand Down Expand Up @@ -129,7 +130,15 @@ function LedgerSignStacksTxContainer() {
signedTx,
});
} catch (e) {
ledgerNavigate.toBroadcastErrorStep(isError(e) ? e.message : 'Unknown error');
const error = isError(e) ? e.message : 'Unknown error';
void analytics.track('ledger_transaction_publish_error', {
error: {
message: error,
error: e,
},
});

ledgerNavigate.toBroadcastErrorStep(error);
return;
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export function SendInscriptionReview() {
});
},
onError(e) {
void analytics.track('broadcast_ordinal_transaction_error', { error: e });
navigate(`/${RouteUrls.SendOrdinalInscription}/${RouteUrls.SendOrdinalInscriptionError}`, {
state: {
error: e,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export function Brc20SendFormConfirmation() {
});
},
onError(e) {
void analytics.track('broadcast_brc20_transaction_error', {
error: e,
});

nav.toErrorPage(e);
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ export function BtcSendFormConfirmation() {
);
},
onError(e) {
void analytics.track('btc_transaction_broadcast_error', {
error: e,
});
nav.toErrorPage(e);
},
});
Expand Down Expand Up @@ -194,7 +197,7 @@ export function BtcSendFormConfirmation() {
<Stack pb="space.06" px="space.06" width="100%">
<InfoCardRow
title="To"
value={<FormAddressDisplayer address={recipient} />}
value={<FormAddressDisplayer address={recipient} />} // maybe here pete? could this crash if no address???? probablynot
data-testid={SendCryptoAssetSelectors.ConfirmationDetailsRecipient}
/>
<InfoCardSeparator />
Expand Down

0 comments on commit dbe752f

Please sign in to comment.