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

update ethjs-query to @metamask/ethjs-query #21035

Merged
merged 3 commits into from
Sep 26, 2023
Merged

Conversation

brad-decker
Copy link
Contributor

@brad-decker brad-decker commented Sep 25, 2023

Description

Our fork of ethjs-query has been namespaced to the @metamask/ namespace, and updated with mostly development only fixes. There is one exception which is the reason for this pull request which is the removal of a try/catch that was catching too broadly and wrapping legitimate errors in a new Error object that claimed the issue was with the formatting of the output. In most cases this is incorrect and results in a wide swath of errors being lumped together inside of sentry. This change will result in the real errors being surfaced, after which we can decide where to prioritize efforts to resolve RPC issues.

This PR progresses, and is expected to change the stack trace for the following issues:
#9317
#10519
#10619
#11488
#11974
#13395
#14298
#14365
#15250
#17073
#17803
#19697
#20699

We are closing these issues opened automatically by sentry-io which are not fully resolved but should result in better errors and stack traces:

fixes #10552
fixes #14660
fixes #14676
fixes #14730
fixes #14801
fixes #15065

Manual testing steps

  1. Attempt to reproduce any of the bugs listed, 17073 was the easiest to reproduce for me. This involves getting test currency from the wemix faucet as listed in the issue and initiating a transaction between two accounts you own.
  2. On develop you'll see an 'error formatting outputs' error text similar to what is reported in the issue.
  3. On this branch you'll get the original error, without the wrapped 'formatting' error. including a different stack trace.

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • 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.

@socket-security
Copy link

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

Packages Version New capabilities Transitives Size Publisher
@metamask/ethjs-query 0.5.0 environment +0 596 kB

@socket-security
Copy link

socket-security bot commented Sep 25, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: @metamask/[email protected]

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore [email protected] bar@* or ignore all packages with @SocketSecurity ignore-all

@brad-decker
Copy link
Contributor Author

@SocketSecurity ignore @metamask/[email protected]

@brad-decker
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (789c2f3) 68.33% compared to head (ee44367) 68.34%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #21035   +/-   ##
========================================
  Coverage    68.33%   68.34%           
========================================
  Files         1007     1007           
  Lines        40254    40254           
  Branches     10761    10761           
========================================
+ Hits         27507    27508    +1     
+ Misses       12747    12746    -1     
Files Coverage Δ
app/scripts/controllers/transactions/index.js 72.64% <ø> (ø)
...pts/controllers/transactions/pending-tx-tracker.js 95.28% <100.00%> (ø)
...p/scripts/controllers/transactions/tx-gas-utils.js 85.71% <ø> (ø)
app/scripts/lib/ens-ipfs/resolver.js 0.00% <ø> (ø)

... and 1 file with indirect coverage changes

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

@metamaskbot
Copy link
Collaborator

Builds ready [ee44367]
Page Load Metrics (965 ± 375 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint851771062010
domContentLoaded66159982211
load801898965781375
domInteractive66159982211
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 3.32 KiB (0.09%)
  • ui: 9 Bytes (0.00%)
  • common: 301 Bytes (0.01%)

@brad-decker brad-decker marked this pull request as ready for review September 25, 2023 22:17
@brad-decker brad-decker requested review from a team as code owners September 25, 2023 22:17
@DDDDDanica
Copy link
Contributor

Tested locally and the error message is more clear, LGTM.

Screenshot 2023-09-26 at 12 06 41

@brad-decker brad-decker merged commit ac5bdba into develop Sep 26, 2023
9 checks passed
@brad-decker brad-decker deleted the update-ethjs-query branch September 26, 2023 14:57
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2023
@metamaskbot metamaskbot added the release-11.3.0 Issue or pull request that will be included in release 11.3.0 label Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.