MetaMask / snaps

Extend the functionality of MetaMask using Snaps
https://metamask.io/snaps/
Other
709 stars 546 forks source link

Simulator not accepting manifests with numbers in endowment:rpc.maxRequestTime #2507

Open zwilling opened 1 week ago

zwilling commented 1 week ago

Hello,

While trying to verify an updated manifest in https://metamask.github.io/snaps/snaps-simulator/latest/#/manifest , the simulator rejects our permissions with the error message

At path: endowment:rpc.maxRequestTime -- Expected a value of type `never`, but received: `180000`

This seems wrong because the documentation suggests that this field accepts numbers: https://docs.metamask.io/snaps/reference/permissions/#snap-defined-timeouts

To reproduce it, you can

  1. Open https://metamask.github.io/snaps/snaps-simulator/latest/#/manifest
  2. Configure the snap npm:@galactica-net/snap with version 0.7.3.
  3. Apply the config

It looks like the error was already reported for snaps-cli in https://github.com/MetaMask/snaps/issues/2290 and has been fixed in https://github.com/MetaMask/snaps/pull/2291 . The latest npm release of the snaps-simulator is older than the fix.

Could it be that the simulator just needs to be rebuild and redeployed with the updated dependencies?

Nick-1979 commented 1 week ago

I am experiencing a similar issue, when I include the following configuration in my Snap manifest:

"endowment:lifecycle-hooks": {
    "maxRequestTime": 18000
},

I encounter an error during the installation process: Error#95: Permissions for target "endowment: lifecycle-hooks" may not have caveats of type "maxRequestTime".

FrederikBolding commented 5 days ago

@zwilling The Simulator definitely needs to be updated, there is just a few breaking changes that need to land before then. Once https://github.com/MetaMask/snaps/pull/2409 is merged, we should be able to cut a new release of the simulator and fix this problem 👍