Skip to content

Conversation

@zerts
Copy link
Collaborator

@zerts zerts commented May 23, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented May 23, 2025

📦 build.zip [updated at May 23, 3:09:31 PM UTC]

@zerts zerts marked this pull request as ready for review May 23, 2025 15:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

The purpose of this PR is to pass the transaction send status to the analytics service by tracking successful and failed transaction events.

  • Introduces a new helper function (trackSentTransaction) to standardize analytics payload construction.
  • Updates event emission for failed transaction sends via a new "transactionSendFailed" event in analytics and events files.
  • Enhances error handling in the Wallet module to integrate with the new analytics flow.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/shared/analytics/analytics.background.ts Adds trackSentTransaction function and refactors tracking logic.
src/background/events.ts Introduces a new "transactionSendFailed" event type.
src/background/Wallet/Wallet.ts Updates error handling to emit transaction failure analytics.

return safeTxPlain;
} catch (error) {
throw getEthersError(error);
const parsedError = getEthersError(error);
Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The error handling code here duplicates logic by emitting the 'transactionSendFailed' event and throwing the error immediately after; consider extracting this common logic into a helper function to reduce duplication.

Copilot uses AI. Check for mistakes.
Comment on lines +1513 to 1521
const parsedError = getEthersError(error);
emitter.emit('transactionSendFailed', {
message: getError(parsedError).message,
...transactionContextParams,
});
throw parsedError;
}
}

Copy link

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Similar to the earlier catch block, the error handling logic is repeated here; abstracting this into a shared function would improve code maintainability and reduce the potential for inconsistencies.

Suggested change
const parsedError = getEthersError(error);
emitter.emit('transactionSendFailed', {
message: getError(parsedError).message,
...transactionContextParams,
});
throw parsedError;
}
}
this.handleTransactionError(error, transactionContextParams);
}
}
private handleTransactionError(
error: unknown,
contextParams: TransactionContextParams
): never {
const parsedError = getEthersError(error);
emitter.emit('transactionSendFailed', {
message: getError(parsedError).message,
...contextParams,
});
throw parsedError;
}

Copilot uses AI. Check for mistakes.
@zerts
Copy link
Collaborator Author

zerts commented Nov 3, 2025

Done in #829

@zerts zerts closed this Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants