endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
804 stars 71 forks source link

`M.callWhen().optional(...)` causes rejections #1858

Closed michaelfig closed 10 months ago

michaelfig commented 10 months ago

Describe the bug

Steps to reproduce

Many Agoric SDK unit tests are failing with the same kind of error.

not ok 36 - name-hub › nameAdmin provideChild %ava-dur=40ms
  ---
    name: AssertionError
    message: Rejected promise returned by test
    values:
      'Rejected promise returned by test. Reason:': |-
        TypeError {
          message: 'Cannot read properties of undefined (reading \'length\')',
        }
    at: 'async packages/vats/test/test-name-hub.js:185:17'
  ...

Investigating packages/vats/test/test-name-hub.js:185:17 leads eventually to the following InterfaceGuard.

Furthermore, this error could be reproduced by calling a method guarded by M.callWhen().optional(M.arrayOf(M.any())).returns(), namely a callWhen with an optional arrayOf.

Expected behavior

No error.

Platform environment

Agoric SDK CI

Additional context

Screenshots