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

fix: use correct property name for redesign #24579

Merged
merged 3 commits into from
May 20, 2024
Merged

Conversation

pnarayanaswamy
Copy link
Contributor

@pnarayanaswamy pnarayanaswamy commented May 17, 2024

Description

Fixes the bug where the ui_customization property does not show up in the metrics event.
Also fixed the mapping such that the ui_customization property shows up for the eth_signTypedData as well.

Open in GitHub Codespaces

Related issues

Fixes: #24578

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • 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.

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.

@pnarayanaswamy pnarayanaswamy requested a review from a team as a code owner May 17, 2024 09:12
@pnarayanaswamy pnarayanaswamy added the team-confirmations Push issues to confirmations team label May 17, 2024
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.

@metamaskbot
Copy link
Collaborator

Builds ready [141a1fe]
Page Load Metrics (1083 ± 539 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint691771033215
domContentLoaded98018157
load56254610831122539
domInteractive98018157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 57 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.37%. Comparing base (576670f) to head (141a1fe).
Report is 1 commits behind head on develop.

Current head 141a1fe differs from pull request most recent head 31eb4ce

Please upload reports for the commit 31eb4ce to get more accurate results.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #24579   +/-   ##
========================================
  Coverage    67.37%   67.37%           
========================================
  Files         1289     1289           
  Lines        50219    50219           
  Branches     13005    13005           
========================================
  Hits         33834    33834           
  Misses       16385    16385           

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

@@ -60,6 +60,8 @@ const ETH_METHOD_TO_APPROVAL_TYPE = {
[EthMethod.PersonalSign]: ApprovalType.PersonalSign,
[EthMethod.Sign]: ApprovalType.Sign,
[EthMethod.SignTransaction]: ApprovalType.SignTransaction,
// This method does not seem to be available in the EthMethod but supported by the test dapp
eth_signTypedData: ApprovalType.EthSignTypedData,
Copy link
Member

Choose a reason for hiding this comment

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

I know it's not introduced your PR but can we use MESSAGE_TYPE from shared/constants/app.ts and remove EthMethod from this file?
In order to do that we must add eth_signTypedData_v1 into MESSAGE_TYPE as well which is totally fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to change it but I am not sure behind what the rationale was in adding it in the first place. @digiwand maybe you can clarify before I change it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also the MESSAGE_TYPE misses eth_signTransaction and eth_signTypedData_v1

Copy link
Member

Choose a reason for hiding this comment

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

My reasoning was just to remove a dependency to a package since we have these constants in app. And yes as I mentioned in the previous message it's totally fine to add that constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense, I will change it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done @OGPoyraz

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! I was confused with what this type in this middleware represented.

I assumed ETH_METHODS since these are coming from the JSON_RPC request and it seems I assumed incorrectly. Thanks for the catch and the fix! cc: @pnarayanaswamy @OGPoyraz


side note, though related: I have in my notes to understand more the differences and use-cases for our various transaction-related types. If anyone has more intel into any specifics of these, please share

Eth Methods - EthMethod
Signatures - SIGNING_METHODS
Transactions - TransactionType

Approvals - ApprovalType
Confirmations - CONFIRMATION_METHODS
Message - MESSAGE_TYPE

@metamaskbot
Copy link
Collaborator

Builds ready [31eb4ce]
Page Load Metrics (730 ± 490 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint63130892010
domContentLoaded9451384
load4924297301019490
domInteractive9451384
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: -18 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 89 Bytes (0.00%)

Copy link
Contributor

@digiwand digiwand left a comment

Choose a reason for hiding this comment

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

Lgtm!

@pnarayanaswamy pnarayanaswamy merged commit f3b5040 into develop May 20, 2024
71 of 72 checks passed
@pnarayanaswamy pnarayanaswamy deleted the fix-metrics branch May 20, 2024 08:09
@github-actions github-actions bot locked and limited conversation to collaborators May 20, 2024
@metamaskbot metamaskbot added the release-11.18.0 Issue or pull request that will be included in release 11.18.0 label May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.18.0 Issue or pull request that will be included in release 11.18.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Metrics do not show the ui_customization property
5 participants