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

[cherry-pick Confirmations Metrics PRs] fix: After triggering a Transaction, a Signature request metrics even… #21943

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Nov 22, 2023

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 added release-11.6.0 Issue or pull request that will be included in release 11.6.0 release-blocker This bug is blocking the next release labels Nov 22, 2023
@seaona
Copy link
Contributor Author

seaona commented Nov 22, 2023

QA in Progress

🟢 In this branch I am seeing this fixed #21753
🟢 In this branch I am seeing this fixed #21738
🔴 but I am still seeing this #21770

@seaona seaona changed the title [cherry-pick] fix: After triggering a Transaction, a Signature request metrics even… [cherry-pick Confirmations Metrics PRs] fix: After triggering a Transaction, a Signature request metrics even… Nov 22, 2023
@seaona seaona added the team-confirmations-secure-ux-PR PRs from the confirmations team label Nov 23, 2023
@seaona
Copy link
Contributor Author

seaona commented Nov 23, 2023

QA Pass

🟢 In this branch I am seeing this fixed #21753
🟢 In this branch I am seeing this fixed #21738
🟢 In this branch I am seeing this fixed #21770

metrics-fixed.mp4

@seaona seaona marked this pull request as ready for review November 23, 2023 08:46
@seaona seaona requested a review from a team as a code owner November 23, 2023 08:46
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Nov 23, 2023
@seaona
Copy link
Contributor Author

seaona commented Nov 23, 2023

Comments on the failing jobs:

  • There is an audit dependency failing job. It is also present in the RC branch. We think this PR would fix it, but we defer to the release team to include the fix or not (possibly not in this cherry pick PR)
  • In the RC branch 15 unit tests were failing related to metrics. In this branch most of them are fixed with the recent cherry pick, but 2 failures remain. From @segun , it seems we might need to cherry pick another PR in order to fix those, but that PR includes other changes, not worked by our team. We also defer the release team to decide what should we do in this case

cc @danjm

@seaona seaona mentioned this pull request Nov 23, 2023
13 tasks
…t is also triggered (#21753)

## **Description**

Problem: after triggering any transaction (not a signature) we can see
how now a Signature request is also triggered. Additionally, the
information about RPC requests is held in the Signature request (which
should not be there) instead of in the transaction request.

## **Expected behavior**
No Signature event should be triggered if we perform a transaction
RPC information should be held inside the transaction request, instead
of the signature, for transactions

## **Fix**
We are sending signature events on confirm page, we shouldn't. This call
is now removed. Then on Transaction Events, we should add the blockaid
RPC calls. There's already a code for this in metrics helper. We just
need to call this in metrics to add the blockaid params.

## **Related issues**

Fixes: #21739 

## **Manual testing steps**

1. Enable a metrics project / or look the background console
2. Select Mainnet
3. Go to the test dapp
4. Trigger a transaction
5. See how no info about RPC is held in the transaction event
6. See how a Signature request is also triggered, alongside the
transaction
7. Checkout this branch
8. Repeat step 1-4
9. See how RPC info is sent in Transaction Added event
10. See how no signature request event is triggered.

## **Screenshots/Recordings**

### **Before**

https://github.com/MetaMask/metamask-extension/assets/54408225/96293fc6-507c-41d1-9fbc-e38a011ff845

### **After**


https://github.com/MetaMask/metamask-extension/assets/44811/44bbd5f6-247a-4369-8b2c-9f3c8c180075


## **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 <[email protected]>
…nature (#21955)

## **Description**

For some reason, [this
merge](#21791) is
showing this warning on Github
<img width="1630" alt="Screenshot 2023-11-23 at 02 53 46"
src="https://github.com/MetaMask/metamask-extension/assets/44811/8486638c-09da-4e88-a8d0-54e3adedb527">

So I cherry picked it to develop and created this new PR.

This is basically a copy and paste of #21791 but this time using develop
as base.

Below is the original Description copied over from 21791 for completion
----------
When you click on a signature request that is flagged by PPOM, 2 events
are sent to metrics instead of 1.

### Expected behavior

Just 1 Signature request should be triggered for a Signature event
flagged by PPOM

## **Related issues**

Fixes: #21770 

## **Manual testing steps**

1. Launch MM
2. Open background console and open the network app, make sure it's
recording network requests
3. Open testdapp
4. Click on any of the signature requests for PPOM e.g Malicious Trade
Order
5. Go to background console network tab and see 2 signature requests
called as shown in the video
6. Checkout this branch, build and run MM
7. Repeat steps 2-4
8. On the background console, you should now see only 1 signature
request sent.

## **Screenshots/Recordings**

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

### **Before**

[<!-- [screenshots/recordings]
-->](https://github.com/MetaMask/metamask-extension/assets/54408225/926b1da1-deac-45b3-91d9-f55f5da6cbe6)

### **After**


https://github.com/MetaMask/metamask-extension/assets/44811/f7f32a58-dcff-4a76-8bdb-6579d6693b88

## **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.
@danjm danjm force-pushed the cherry-pick-confirmations branch from e1236d4 to 3ef4a2c Compare November 23, 2023 21:48
@danjm danjm merged commit 6d1de3e into Version-v11.6.0 Nov 23, 2023
60 of 61 checks passed
@danjm danjm deleted the cherry-pick-confirmations branch November 23, 2023 22:23
@github-actions github-actions bot locked and limited conversation to collaborators Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-11.6.0 Issue or pull request that will be included in release 11.6.0 release-blocker This bug is blocking the next release team-confirmations-secure-ux-PR PRs from the confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants