Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add extra event props #26123

Merged
merged 5 commits into from
Jul 26, 2024
Merged

chore: Add extra event props #26123

merged 5 commits into from
Jul 26, 2024

Conversation

dan437
Copy link
Contributor

@dan437 dan437 commented Jul 25, 2024

Description

Adds extra event props related to HW wallets, which are already used in multiple other events.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Look for the new props in these events: STX Swap Started, STX Status Updated and STX Confirmed.

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@dan437 dan437 added the team-transactions Transactions team label Jul 25, 2024
@dan437 dan437 requested a review from a team as a code owner July 25, 2024 12:18
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link

socket-security bot commented Jul 25, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/[email protected] network 0 187 kB metamaskbot

🚮 Removed packages: npm/@metamask/[email protected]

View full report↗︎

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added extra event properties related to hardware wallets for enhanced MetaMetrics tracking.

  • app/scripts/metamask-controller.js: Added getMetaMetricsProps function to retrieve hardware wallet details.
  • package.json: Updated @metamask/smart-transactions-controller dependency to version ^11.0.0.
  • shared/modules/selectors/index.ts: Imported and exported getHardwareWalletType for broader access.
  • ui/ducks/swaps/swaps.js: Added is_hardware_wallet and hardware_wallet_type properties to swap events.
  • shared/constants/metametrics.ts: Updated MetaMetrics event names to include hardware wallet details.

4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@dan437 dan437 force-pushed the extra-stx-props branch from f2fdcef to 17d1a74 Compare July 25, 2024 12:22
dbrans
dbrans previously approved these changes Jul 25, 2024
@dbrans
Copy link
Contributor

dbrans commented Jul 25, 2024

LGTM!

@dan437
Copy link
Contributor Author

dan437 commented Jul 25, 2024

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Added extra event properties related to hardware wallets for enhanced MetaMetrics tracking and improved type safety across the codebase.

  • test/e2e/tests/confirmations/alerts/queued-confirmations.spec.ts: Introduced end-to-end tests for queued confirmations, covering both old and redesigned flows.
  • ui/pages/confirmations/components/confirm/info/row/text-token-units.tsx: Added a new component for formatting and displaying token amounts with precision.
  • ui/pages/confirmations/hooks/alerts/transactions/useQueuedConfirmationsAlerts.ts: Introduced a custom hook for generating alerts for queued confirmations.
  • ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.tsx: Converted from JavaScript to TypeScript, enhancing type safety and maintainability.
  • ui/pages/confirmations/components/signature-request-original/signature-request-original.component.js: Added QueuedRequestsBannerAlert component to enhance user awareness of pending actions.

69 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Added extra event properties related to hardware wallets for enhanced MetaMetrics tracking and improved type safety across the codebase.

  • lavamoat/browserify/beta/policy.json: Added new package dependencies and global variables, including uuid and @metamask/rpc-errors.
  • lavamoat/browserify/flask/policy.json: Introduced uuid package and new global variables TextDecoder and TextEncoder.
  • lavamoat/browserify/main/policy.json: Updated to include uuid, @metamask/rpc-errors, and other packages for hardware wallet event properties.
  • lavamoat/browserify/mmi/policy.json: Enabled uuid, @metamask/rpc-errors, and additional packages for hardware wallet support.

Ensure thorough testing to verify compatibility and security.

4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@metamaskbot
Copy link
Collaborator

Builds ready [aefc9df]
Page Load Metrics (84 ± 23 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint723791166330
domContentLoaded118531189
load48279844823
domInteractive118531189
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.82 KiB (0.05%)
  • ui: 0 Bytes (0.00%)
  • common: 38.36 KiB (0.56%)

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 69.93%. Comparing base (3d93d82) to head (34fd2b2).
Report is 1 commits behind head on develop.

Files Patch % Lines
app/scripts/metamask-controller.js 0.00% 6 Missing ⚠️
ui/ducks/swaps/swaps.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26123      +/-   ##
===========================================
- Coverage    69.94%   69.93%   -0.01%     
===========================================
  Files         1409     1409              
  Lines        49794    49802       +8     
  Branches     13773    13773              
===========================================
  Hits         34826    34826              
- Misses       14968    14976       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dan437 dan437 force-pushed the extra-stx-props branch from aefc9df to 66142ed Compare July 25, 2024 13:34
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Added extra event properties related to hardware wallets for enhanced MetaMetrics tracking and improved type safety across the codebase.

  • app/scripts/metamask-controller.js: Integrated new properties accountHardwareType, accountType, and deviceModel into events STX Swap Started, STX Status Updated, and STX Confirmed.
  • package.json: Updated @metamask/smart-transactions-controller dependency to version ^11.0.0.
  • shared/modules/selectors/index.ts: Added and exported getHardwareWalletType selector.
  • ui/components/multichain/network-list-item/network-list-item.js: Introduced startAccessory and showEndAccessory props for enhanced component customization.
  • ui/ducks/swaps/swaps.js: Added is_hardware_wallet and hardware_wallet_type properties to swaps smart transaction process.

Ensure thorough testing to verify compatibility and security.

10 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@metamaskbot
Copy link
Collaborator

Builds ready [66142ed]
Page Load Metrics (205 ± 270 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint772961124722
domContentLoaded993312010
load482650205562270
domInteractive993312010
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.82 KiB (0.05%)
  • ui: 0 Bytes (0.00%)
  • common: 38.36 KiB (0.56%)

@dan437 dan437 force-pushed the extra-stx-props branch from 66142ed to 34fd2b2 Compare July 26, 2024 11:28
Copy link

@metamaskbot
Copy link
Collaborator

Builds ready [34fd2b2]
Page Load Metrics (80 ± 16 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint772111113617
domContentLoaded997292210
load46184803416
domInteractive997292110
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.82 KiB (0.05%)
  • ui: 0 Bytes (0.00%)
  • common: 38.36 KiB (0.56%)

@dan437 dan437 merged commit 0e503c3 into develop Jul 26, 2024
76 checks passed
@dan437 dan437 deleted the extra-stx-props branch July 26, 2024 12:18
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2024
@metamaskbot metamaskbot added the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Jul 26, 2024
@gauthierpetetin gauthierpetetin added release-12.3.0 Issue or pull request that will be included in release 12.3.0 and removed release-12.4.0 Issue or pull request that will be included in release 12.4.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-transactions Transactions team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants