-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Add PermittedHandlerExport
to permission-controller
#1184
base: main
Are you sure you want to change the base?
Conversation
New dependency changes detected. Learn more about Socket for GitHub ↗︎ 🚨 Potential security issues found in this pull request. To accept the risk, merge this PR and you will not be notified again. Bot CommandsTo ignore an alert, reply with a comment starting with
|
Package | Location | Source |
---|---|---|
@metamask/json-rpc-engine@7.0.0 (added) | package.json | packages/permission-controller/package.json |
Pull request alert summary
📊 Modified Dependency Overview:
➕ Added Package | Capability Access | +/- Transitive Count |
Publisher |
---|---|---|---|
@metamask/json-rpc-engine@7.0.0 | None | +1 |
metamaskbot |
@metamask/rpc-errors@5.1.1 | None | +0 |
metamaskbot |
🚮 Removed packages: @metamask/types@1.1.0
49be581
to
9d183f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to get a second review on this, but seems like a reasonable change to me.
@Mrtenz Changes look reasonable to me but especially given that effectively used versions of could we break out all the dependency updates into a separate PR, which would precede the |
55e256b fixes this error (but as noted above IMO this should be broken out with the upgrades) |
4eff32a
to
55e256b
Compare
|
Thanks @legobeat! Will update this PR once that's merged. |
55e256b
to
8e80463
Compare
Blocked by MetaMask/rpc-errors#91. |
packages/permission-controller/src/rpc-methods/requestPermissions.test.ts
Outdated
Show resolved
Hide resolved
bc01c35
to
394834f
Compare
8ccde14
to
2c37d50
Compare
@@ -1,5 +1,5 @@ | |||
import assert from 'assert'; | |||
import { JsonRpcEngine, PendingJsonRpcResponse } from 'json-rpc-engine'; | |||
import { JsonRpcEngine } from '@metamask/json-rpc-engine'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we will get type issues by just updating json-rpc-engine
in this package alone 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this will make the PermissionController minimum Node 16. Are we ready for that in this repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @FrederikBolding.
We don't currently supporting bumping the minimum Node version for select packages in this monorepo. The Node version would have to be bumped across the board.
I'm not sure if we are ready to do this Update: It looks like we are getting pretty close to bumping to Node 16 on mobile, so this may not be a problem, but either way, it might be good to bump @metamask/json-rpc-engine
in another PR for visibility, if that's possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bumping @metamask/json-rpc-engine
requires bumping @metamask/utils
and @metamask/rpc-errors
, due to type conflicts with @metamask/types
otherwise. I could cherry-pick the first commit into a separate PR, if that makes it more clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of today bumping this library to 16 should not be a problem as mobile is now running Node 16.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mrtenz Cherry-picking the first commit in a separate PR makes sense. We should also make a new PR that bumps the minimum version of Node to 16 across the board so we can codify that in the next release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried cherry-picking without including the new PermittedHandlerExport
, but the types are not compatible between @metamask/types
and @metamask/utils
, so that doesn't really work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All packages in this repo now require Node 16, so that part is at least done.
a785e17
to
6003a97
Compare
Happy to re-review this when the conflicts are resolved. |
…sk/utils` in `permission-controller` In order to remove the dependency on `@metamask/types` inside `snaps-monorepo`, we need the `PermittedHandlerExport` type. This type depends on types from the `@metamask/json-rpc-engine` package, which were previously duplicated inside `@metamask/types`. In this commit, I have moved `PermittedHandlerExport` to this package, which required bumping `@metamask/json-rpc-engine`, `@metamask/rpc-errors`, and `@metamask/utils`.
This commit updates "@metamask/rpc-errors" package to version "^5.1.1" in package.json and yarn.lock files. This will resolve an issue related to an internal error in PermissionController caused by this dependency.
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
Some error objects should have a 'cause' field that will capture inner causes of particular errors.
6003a97
to
f05f318
Compare
Description
The primary intent of this change is to move
PermittedHandlerExport
from@metamask/types
to thepermission-controller
package. This required some additional changes however.@metamask/json-rpc-engine
was updated to the latest version, so we can use the latest types for thePermittedHandlerExport
. This required updating@metamask/rpc-errors
(previouslyeth-rpc-errors
) and@metamask/utils
too.See the changelog below for a more detailed explanation.
Changes
PermittedHandlerExport
type.@metamask/json-rpc-engine
,@metamask/rpc-errors
, and@metamask/utils
inpermission-controller
to the latest version.eth-rpc-errors
has been changed to use@metamask/rpc-errors
.RestrictedMethodParameters
now acceptsundefined
instead ofvoid
, asvoid
is not compatible with ourJsonRpcParams
type.yarn.lock
.yarn dedupe
.Checklist