Skip to content

fix(deps): update from eth-rpc-errors to @metamask/rpc-errors (cause edition)#24496

Merged
Gudahtt merged 8 commits intoMetaMask:developfrom
legobeat:deps-eth-rpc-errors-testing2
Oct 16, 2024
Merged

fix(deps): update from eth-rpc-errors to @metamask/rpc-errors (cause edition)#24496
Gudahtt merged 8 commits intoMetaMask:developfrom
legobeat:deps-eth-rpc-errors-testing2

Conversation

@legobeat
Copy link
Copy Markdown
Contributor

@legobeat legobeat commented May 13, 2024

Description

  • Upgrade from obsolete eth-rpc-errors to @metamask/rpc-errors
    • This introduce handling of error causes

See here for some context.

Open in GitHub Codespaces

Related issues

Blocked by

Blocking

Manual testing steps

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.

@legobeat legobeat added the DO-NOT-MERGE Pull requests that should not be merged label May 13, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 13, 2024

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.

@legobeat legobeat force-pushed the deps-eth-rpc-errors-testing2 branch 3 times, most recently from 81de478 to d2b1465 Compare May 13, 2024 04:50
@legobeat

This comment was marked as resolved.

@legobeat legobeat force-pushed the deps-eth-rpc-errors-testing2 branch 4 times, most recently from 1681c02 to 7dc9514 Compare May 13, 2024 06:57
@legobeat legobeat changed the title testing rpc-errors cause handling fix: testing rpc-errors cause handling May 13, 2024
@legobeat legobeat force-pushed the deps-eth-rpc-errors-testing2 branch 18 times, most recently from 2faf92d to 449fd01 Compare May 13, 2024 21:40
@socket-security
Copy link
Copy Markdown

socket-security bot commented May 25, 2024

👍 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.

View full report↗︎

@legobeat
Copy link
Copy Markdown
Contributor Author

This has now been updated with latest changes from MetaMask/rpc-errors#140

@socket-security
Copy link
Copy Markdown

socket-security bot commented May 31, 2024

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

Package New capabilities Transitives Size Publisher
npm/@metamask/rpc-errors@6.4.0 None 0 165 kB metamaskbot

🚮 Removed packages: npm/@metamask/rpc-errors@6.3.1

View full report↗︎

@Gudahtt
Copy link
Copy Markdown
Member

Gudahtt commented Aug 1, 2024

Thanks @legobeat ! Could you update this and resolve conflicts? I know this has been around a while, but I'll nudge a few teams to prioritize reviewing this as well.

@github-actions
Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.

@legobeat
Copy link
Copy Markdown
Contributor Author

legobeat commented Oct 8, 2024

This has now been updated:


UPDATE

@legobeat

This comment was marked as resolved.

@legobeat
Copy link
Copy Markdown
Contributor Author

legobeat commented Oct 9, 2024

@Gudahtt After just a little back-and-forth:

@metamask/rpc-errors@7.0.0 now reverts back to the previous behavior where RPC error messages are exposed directly as message instead of being replaced with Internal JSON-RPC Error. This PR now updates the direct dependency of the package to latest.

c8709730e017f48f9f6ac80c752f82ad070f80df

Hopefully this should clear up any outstanding concerns/reservations for this migration - let me know otherwise!

@legobeat legobeat mentioned this pull request Oct 9, 2024
andreahaku
andreahaku previously approved these changes Oct 9, 2024
Copy link
Copy Markdown

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

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

LGTM

fix error message handling

fix: prefer cause message as error message

lint:fix

fix: update error handling for nft ownership check

fix: handle error details in error cause

fix test

fixup cause handling

Revert "fix test"

This reverts commit e5ae79be58cf22b873ede78ac8edac08832bcaac.

fix test

fix: isErrorWithMessage return type

Refactor: Handling error.cause; add pony-cause

use getErrorMessage for logging errors

WIP: deps: @metamask/rpc-errors@^6.2.1->6.3.0

test: fix testcase

fix: consider cause instead of data.cause when parsing caught error messages

chore: clean up unused cause-handling code in error.ts

chore: update lavamoat policies

revert stringification of generic objects in logErrorWithMessage

lint:fix
MetaMask/rpc-errors#158

- Update test according to new @metamask/rpc-errors behavior

This partially reverts commit aeca6d797fc16d13bcd16f8649159769207ede78.
@Gudahtt
Copy link
Copy Markdown
Member

Gudahtt commented Oct 16, 2024

Force-merged to override all-jobs-passed required status check, which is failing due to our SonarCloud checknot yet supporting forks.

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

Labels

dependencies Pull requests that update a dependency file release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-application-security Application security team team-confirmations Push issues to confirmations team team-core-extension-ux Core Extension UX team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

8 participants