Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Apr 20, 2023

Bumps @metamask/rpc-errors from 5.0.0 to 5.1.1.

Release notes

Sourced from @​metamask/rpc-errors's releases.

5.1.1

Fixed

  • Allow passing unknown values as cause (#91)
    • Prevously, only Error instances were allowed, but any value can be thrown as error

5.1.0

Added

  • Allow passing a cause to predefined error functions (#83)
    • This allows passing an Error instance as cause, by using { data: { cause: /* some error */ } }
    • The error will be properly serialised when calling serialize
Changelog

Sourced from @​metamask/rpc-errors's changelog.

[5.1.1]

Fixed

  • Allow passing unknown values as cause (#91)
    • Prevously, only Error instances were allowed, but any value can be thrown as error

[5.1.0]

Added

  • Allow passing a cause to predefined error functions (#83)
    • This allows passing an Error instance as cause, by using { data: { cause: /* some error */ } }
    • The error will be properly serialised when calling serialize
Commits
  • af3ef43 5.1.1 (#92)
  • e06f8d8 Allow passing unknown values as cause (#91)
  • 1d1852d 5.1.0 (#90)
  • a388854 Bump @​metamask/utils from 5.0.0 to 5.0.1 (#85)
  • a324a7a Bump ESLint configs and dependencies to latest version (#89)
  • 23c4857 Bump @​metamask/eslint-config-jest from 10.0.0 to 11.1.0 (#88)
  • 90024f9 Standardise workflows per the module template as of April 2023 (#82)
  • e6a9162 Allow passing a cause to predefined error functions (#83)
  • See full diff in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot requested a review from a team as a code owner April 20, 2023 06:57
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Apr 20, 2023
Mrtenz
Mrtenz previously approved these changes Apr 20, 2023
Copy link
Contributor

@legobeat legobeat left a comment

Choose a reason for hiding this comment

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

Looks like types need some updates: https://github.com/MetaMask/json-rpc-engine/actions/runs/4751421966/jobs/8448051639#step:5:8

FAIL src/JsonRpcEngine.test.ts
  ● Test suite failed to run

    src/JsonRpcEngine.test.ts:287:7 - error TS2322: Type 'JsonRpcError<DataWithOptionalCause>' is not assignable to type '{ code: number; message: string; data?: Json | undefined; stack?: string | undefined; }'.
      Types of property 'data' are incompatible.
        Type 'DataWithOptionalCause' is not assignable to type 'Json | undefined'.
          Type '{ [key: string]: unknown; cause: unknown; }' is not assignable to type 'Json | undefined'.
            Type '{ [key: string]: unknown; cause: unknown; }' is missing the following properties from type 'Json[]': length, pop, push, concat, and 29 more.

    287       response.error = rpcErrors.internal({ message: 'foobar' });
              ~~~~~~~~~~~~~~
    src/JsonRpcEngine.test.ts:308:7 - error TS2322: Type 'JsonRpcError<DataWithOptionalCause>' is not assignable to type '{ code: number; message: string; data?: Json | undefined; stack?: string | undefined; }'.

    308       response.error = rpcErrors.internal({ message: 'foobar' });
              ~~~~~~~~~~~~~~
    src/JsonRpcEngine.test.ts:370:9 - error TS2322: Type 'JsonRpcError<DataWithOptionalCause>' is not assignable to type '{ code: number; message: string; data?: Json | undefined; stack?: string | undefined; }'.

    370         response.error = rpcErrors.internal({ message: 'foobar' });
                ~~~~~~~~~~~~~~
    src/JsonRpcEngine.test.ts:405:9 - error TS2322: Type 'JsonRpcError<DataWithOptionalCause>' is not assignable to type '{ code: number; message: string; data?: Json | undefined; stack?: string | undefined; }'.

    405         response.error = rpcErrors.internal({ message: 'foobar' });
                ~~~~~~~~~~~~~~

PASS src/asMiddleware.test.ts
PASS src/mergeMiddleware.test.ts
PASS src/createAsyncMiddleware.test.ts
PASS src/idRemapMiddleware.test.ts
FAIL src/createScaffoldMiddleware.test.ts
  ● Test suite failed to run

    src/createScaffoldMiddleware.test.ts:25:9 - error TS2322: Type 'JsonRpcError<DataWithOptionalCause>' is not assignable to type '{ code: number; message: string; data?: Json | undefined; stack?: string | undefined; }'.
      Types of property 'data' are incompatible.
        Type 'DataWithOptionalCause' is not assignable to type 'Json | undefined'.
          Type '{ [key: string]: unknown; cause: unknown; }' is not assignable to type 'Json | undefined'.
            Type '{ [key: string]: unknown; cause: unknown; }' is missing the following properties from type 'Json[]': length, pop, push, concat, and 29 more.

    25         response.error = rpcErrors.internal({ message: 'method3' });
               ~~~~~~~~~~~~~~


engine.push(function (_request, response, next, _end) {
response.error = rpcErrors.internal({ message: 'foobar' });
response.error = rpcErrors.internal({ message: 'foobar', data: [] });
Copy link
Contributor

Choose a reason for hiding this comment

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

@Mrtenz @FrederikBolding Does this look right to you? Had to add this to make the type pass.

It seems like it should be OK to keep passing unset data here? I don't get exactly how data gets required to fit into Json[], or if the change should be done in @metamask/utils or @metamask/rpc-errors, since I take this as mismatch between the two.

Copy link
Contributor

Choose a reason for hiding this comment

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

@legobeat legobeat requested review from a team, Mrtenz and legobeat April 25, 2023 01:59
@legobeat legobeat force-pushed the dependabot/npm_and_yarn/main/metamask/rpc-errors-5.1.1 branch from d0f1c25 to 0dc46a7 Compare April 28, 2023 01:00
Copy link
Contributor

@legobeat legobeat left a comment

Choose a reason for hiding this comment

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

@legobeat legobeat requested review from Gudahtt and legobeat April 28, 2023 01:02
@legobeat legobeat force-pushed the dependabot/npm_and_yarn/main/metamask/rpc-errors-5.1.1 branch from 8bb635b to 1102f86 Compare July 20, 2023 04:00
@legobeat
Copy link
Contributor

@dependabot recreate

Dependabot couldn't find the original pull request head commit, f15f2cd.
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/main/metamask/rpc-errors-5.1.1 branch from 1102f86 to 0a0b43d Compare July 25, 2023 17:51
@legobeat
Copy link
Contributor

legobeat commented Sep 1, 2023

@dependabot dependabot bot closed this Sep 1, 2023
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/main/metamask/rpc-errors-5.1.1 branch September 1, 2023 00:34
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants