Skip to content
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

AggregateError is not supported on all engines #9504

Closed
mhofman opened this issue Jun 14, 2024 · 0 comments · Fixed by #9508
Closed

AggregateError is not supported on all engines #9504

mhofman opened this issue Jun 14, 2024 · 0 comments · Fixed by #9508
Labels
bug Something isn't working

Comments

@mhofman
Copy link
Member

mhofman commented Jun 14, 2024

Describe the bug

#9275 switched from using a custom AggregateError approach to only relying on a global one. However the version of XS we're using in agoric-sdk does not yet support AggregateError.

Steps to reproduce

None, this is only used in edge case error scenarios, and as such does not seem to be exercised. Comes from an audit of the code.

Expected behavior

Only using features available in all our supported engines

Platform environment

master

Description of the Design

Either revert #9275 or introduce a trusted shim in xsnap-lockdown for AggregateError.

Security Considerations

If going the trusted shim route, we should not introduce a dependency on 3rd party npm packages as that'd require continuous audits on version changes, for which we don't have a good documented process. Vendor in instead.

Test Plan

Besides the edge case scenarios under which this would currently be exercised, it appears we don't run any non swingset tests under XS. So ever if we add a unit test to the internal package, we have no way to run it under XS currently.

@mhofman mhofman added the bug Something isn't working label Jun 14, 2024
@mergify mergify bot closed this as completed in #9508 Jun 15, 2024
@mergify mergify bot closed this as completed in 513adc9 Jun 15, 2024
mhofman added a commit that referenced this issue Jun 20, 2024
…9508)

closes: #9504

## Description

While #9275 switched to a global `AggregrateError` constructor, it was unclear if that was safe because that global is not currently available in xsnap. Instead of reverting, this PR moves the "shared" internal helpers that used an `AggregateError` to the `node` folder, to make it clear they should only be used in that environment. All usages of these helpers were already in Node only.

All other usages of `AggregateError` were audited to confirm they only happened on Node as well.

### Security Considerations
None

### Scaling Considerations
None

### Documentation Considerations
None

### Testing Considerations
We're unfortunately lacking coverage of some code under xsnap, Open to ideas on how to improve testing here

It would also be nice somehow to make sure the `node` folders do no end up imported in bundled code. Maybe having a pseudo `import 'node:process'` could work? @kriskowal 

### Upgrade Considerations
None
mhofman added a commit that referenced this issue Jun 22, 2024
…9508)

closes: #9504

## Description

While #9275 switched to a global `AggregrateError` constructor, it was unclear if that was safe because that global is not currently available in xsnap. Instead of reverting, this PR moves the "shared" internal helpers that used an `AggregateError` to the `node` folder, to make it clear they should only be used in that environment. All usages of these helpers were already in Node only.

All other usages of `AggregateError` were audited to confirm they only happened on Node as well.

### Security Considerations
None

### Scaling Considerations
None

### Documentation Considerations
None

### Testing Considerations
We're unfortunately lacking coverage of some code under xsnap, Open to ideas on how to improve testing here

It would also be nice somehow to make sure the `node` folders do no end up imported in bundled code. Maybe having a pseudo `import 'node:process'` could work? @kriskowal 

### Upgrade Considerations
None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant