Skip to content

Conversation

digiwand
Copy link
Contributor

@digiwand digiwand commented Jan 23, 2024

Description

Various updates related to Blockaid metrics

Fixes

Feat

Cleanup

  • removes current MetaMetricsEventName.ExternalLinkClicked / onSupportLinkClicked metric events for Blockaid
  • adds external_link_clicked fragment prop to transaction metrics related to Blockaid
  • let uiCustomizationsconst uiCustomizations = [];
  • other various cleanup e.g.:
    • rename variables
    • update test phrases

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/1756

Manual testing steps

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@github-actions
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.

- getBlockaidMetricsParams
  - add external_link_clicked
  - return result type for all types
  - return reason for all types
- clean uiCustomizations
  - let -> const
- update "NotApplicable" type logic. should not change final result. test updated based on guardrails
- fix early return
- no early return on fail type and allow resultType and reason to be added to params with it
@metamaskbot
Copy link
Collaborator

Builds ready [c25c418]
Page Load Metrics (779 ± 40 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint82144107147
domContentLoaded9331663
load68310157798440
domInteractive9331663
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -483 Bytes (-0.01%)
  • ui: -2.78 KiB (-0.04%)
  • common: 151 Bytes (0.00%)

@digiwand digiwand added team-confirmations-secure-ux-PR PRs from the confirmations team area-metrics labels Jan 25, 2024
digiwand added a commit to MetaMask/core that referenced this pull request Jan 25, 2024
## Explanation

This prop is used to pass a value used to be added as a transaction
metametric fragment prop.

## References

<!--
Are there any issues that this pull request is tied to? Are there other
links that reviewers should consult to understand these changes better?

For example:

-->

Fixes https://github.com/MetaMask/MetaMask-planning/issues/1756
Related to MetaMask/metamask-extension#22631

## Changelog

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

### `@metamask/transaction-controller`

- **feat**: Adds `externalLinkClicked` prop to TransactionMetaBase type

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
digiwand added a commit to MetaMask/core that referenced this pull request Jan 26, 2024
…3854)

Reverts #3828

no longer needed after discovering we can update the event fragment
ad-hoc using the useTransactionEventFragment hook

Related to MetaMask/metamask-extension#22631
- pass transaction rather than pass securityAlertResponse for ease of use
security_alert_reason: BlockaidReason.setApprovalForAll,
});
});
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A few tests were added here from the original. The filepath name change triggered GH to read this as a brand new file rather than a mere file path change. to see previous changes refer to https://github.com/MetaMask/metamask-extension/pull/22631/files#diff-2170a0c1976571856c2f505ee2b08d977d41c03ab57afc38c350753ee4fd8684

@digiwand digiwand marked this pull request as ready for review January 27, 2024 00:09
@digiwand digiwand requested a review from a team as a code owner January 27, 2024 00:09
@metamaskbot
Copy link
Collaborator

Builds ready [48d8739]
Page Load Metrics (995 ± 70 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1141911432010
domContentLoaded135631147
load851154699514670
domInteractive135631147
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -392 Bytes (-0.01%)
  • ui: -3.48 KiB (-0.05%)
  • common: 420 Bytes (0.01%)

@codecov
Copy link

codecov bot commented Jan 29, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (3fe9956) 68.11% compared to head (48d8739) 68.14%.
Report is 52 commits behind head on develop.

Files Patch % Lines
ui/helpers/utils/metrics.js 83.87% 5 Missing ⚠️
app/scripts/lib/transaction/metrics.ts 77.78% 2 Missing ⚠️
ui/hooks/useTransactionEventFragment.js 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22631      +/-   ##
===========================================
+ Coverage    68.11%   68.14%   +0.02%     
===========================================
  Files         1086     1086              
  Lines        42628    42614      -14     
  Branches     11340    11337       -3     
===========================================
+ Hits         29035    29036       +1     
+ Misses       13593    13578      -15     

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

@digiwand digiwand added the type-bug Something isn't working label Jan 31, 2024
@digiwand digiwand changed the title Feat blockaid external link clicked metric update [Bug|Feat] blockaid external link clicked metric update Jan 31, 2024
@digiwand digiwand merged commit 9a92987 into develop Feb 1, 2024
@digiwand digiwand deleted the feat-blockaid-external-link-clicked-metric-update branch February 1, 2024 15:02
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2024
@metamaskbot metamaskbot added the release-11.11.0 Issue or pull request that will be included in release 11.11.0 label Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-metrics release-11.11.0 Issue or pull request that will be included in release 11.11.0 team-confirmations-secure-ux-PR PRs from the confirmations team type-bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants