Skip to content

Conversation

@seaona
Copy link
Member

@seaona seaona commented Feb 16, 2024

Description

Cherry picks:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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.

digiwand and others added 2 commits February 16, 2024 19:07
## **Description**

Various updates related to Blockaid metrics

### Fixes 
- Remove duplicate SignatureRequested SIWE event 
  - related: #21955)
- Removes `security_alert_response` and `security_alert_reason`
transaction, event fragment prop if unnecessary. Previously would add
"not applicable" values to all transaction metrics.

### Feat 
- Add 'external_link_clicked' transaction fragment prop
- Add `security_alert_failed ` ui_customization metric prop
- Removes ExternalLinkClicked from "Report an issue" click
  - related: #22667
- Add test coverage:
  -  utils/metrics:
    - test not applicable resultType and reason
    - test when type is failed, malicious, and benign

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

## **Related issues**

Fixes: MetaMask/MetaMask-planning#1756

## **Manual testing steps**

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] 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](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
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.
## **Description**
With the new async ppom changes, we don't see any more the metrics
information for any Signature (eth_sign, typed signature) and we are now
also missing the ppom request count to Infura for Transactions and
Signatures. We should see it in Transaction/Signature
Confirmed/Rejected.

## **Related issues**

Fixes: #22840 #22841 

## **Manual testing steps**

1. Enable Blockaid
2. Trigger any Signature/Transaction
3. See Metrics
4. Accept/Reject the Signature/Transaction
5. See Metrics in network info

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**


![302900276-b316bcdc-a574-4a60-92db-dc0e4692fc9e-2](https://github.com/MetaMask/metamask-extension/assets/44811/e666d6b5-8095-4b84-8247-c7d6b4385917)


![302901962-355ce267-f234-4373-abe3-17310724618d-2](https://github.com/MetaMask/metamask-extension/assets/44811/d5f1c2c1-1a50-43c3-927d-c1cf78bfcdd6)


### **After**

<img width="1222" alt="Screenshot 2024-02-08 at 14 08 51"
src="https://github.com/MetaMask/metamask-extension/assets/44811/75fd3d07-76a6-404d-856b-ac757169824f">
<img width="1227" alt="Screenshot 2024-02-08 at 14 08 28"
src="https://github.com/MetaMask/metamask-extension/assets/44811/7511a78c-0ec3-4840-b851-6693e81aa67e">


## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained what problem this PR is solving and how it
is solved.
- [x] I've linked related issues
- [x] I've included manual testing steps
- [x] I've included screenshots/recordings if applicable
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [x] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [x] 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.

---------

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>
@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.

@seaona seaona marked this pull request as ready for review February 16, 2024 18:21
@seaona seaona requested a review from a team as a code owner February 16, 2024 18:21
@seaona
Copy link
Member Author

seaona commented Feb 16, 2024

🟢 The issue that I was seeing previously is gone

fix-working-metrics.mp4

About the new added commit:

🟢 The external link click is also working

external-link-clicked.mp4

🟢 SIWE duplicated events are also fixed

duplicate-siwe-fix.mp4

I've found a minor issue with the case of failed validations (that display benign and loading, instead of validation failed), but that could be fixed in a separate PR and it's not a blocker for the release. I can open a separate ticket for that cc @bschorchit @danjm

Screenshot from 2024-02-16 19-23-07

validation-failed-marked-benign-loading.mp4

@seaona seaona changed the title Cherry pick 2 metrics Cherry pick 2 metric PRs for Blockaid Feb 16, 2024
@seaona seaona added the team-confirmations-secure-ux-PR PRs from the confirmations team label Feb 16, 2024
@codecov
Copy link

codecov bot commented Feb 16, 2024

Codecov Report

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

Comparison is base (0c433f6) 68.00% compared to head (9c391ca) 68.03%.

Files Patch % Lines
app/scripts/lib/transaction/util.ts 27.27% 8 Missing ⚠️
ui/helpers/utils/metrics.js 83.87% 5 Missing ⚠️
app/scripts/lib/ppom/ppom-middleware.ts 63.64% 4 Missing ⚠️
app/scripts/lib/transaction/metrics.ts 77.78% 2 Missing ⚠️
ui/hooks/useTransactionEventFragment.js 60.00% 2 Missing ⚠️
...p/scripts/lib/createRPCMethodTrackingMiddleware.js 90.91% 1 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           Version-v11.10.0   #23022      +/-   ##
====================================================
+ Coverage             68.00%   68.03%   +0.04%     
====================================================
  Files                  1087     1087              
  Lines                 42898    42892       -6     
  Branches              11399    11406       +7     
====================================================
+ Hits                  29169    29181      +12     
+ Misses                13729    13711      -18     

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

@seaona
Copy link
Member Author

seaona commented Feb 16, 2024

merging as per Dan's comment

@mariona.farell
if you are happy with that PR from a functional perspective, we can merge it

@seaona seaona merged commit c2d8a9b into Version-v11.10.0 Feb 16, 2024
@seaona seaona deleted the cherry-pick-2-metrics branch February 16, 2024 18:46
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [9c391ca]
Page Load Metrics (796 ± 26 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint95149112147
domContentLoaded10431994
load7159047965526
domInteractive10431994

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

team-confirmations-secure-ux-PR PRs from the confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants