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

refactor(internal): deprecate makeAggregateError in favor of Aggregat… #9275

Merged
merged 4 commits into from
Apr 22, 2024

Conversation

erights
Copy link
Member

@erights erights commented Apr 21, 2024

closes: #XXXX
refs: endojs/endo#2042

Description

Starting at endojs/endo#2042 endo fully supports the real AggregateError constructor, so there is no longer any need for the makeAggregateError workaround. The @agoric/internal packages should not be imported by anything outside the agoric-sdk repo, so technically I could remove it in this same PR. As a conservative don't-break-things, I still export it as deprecated.

Even after upgrading to an endo supporting AggregateError, the old makeAggregateError was emulating it using a direct instance of Error, so this is in theory not a pure refactor. But I would be flabbergasted if any code came to depend on this not being a genuine AggregateError, in which case this change is a pure refactor.

Reviewers, please let me know if you'd prefer that I delete makeAggregateError, as I'd be happy to.

Security Considerations

none

Scaling Considerations

none

Documentation Considerations

none

Testing Considerations

none

Upgrade Considerations

none

@erights erights self-assigned this Apr 21, 2024
Copy link

cloudflare-workers-and-pages bot commented Apr 21, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 84f938d
Status: ✅  Deploy successful!
Preview URL: https://6242ef3d.agoric-sdk.pages.dev
Branch Preview URL: https://markm-deprecate-makeaggregat.agoric-sdk.pages.dev

View logs

@erights erights marked this pull request as ready for review April 21, 2024 04:03
@erights erights requested a review from turadg April 21, 2024 04:03
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

Reviewers, please let me know if you'd prefer that I delete makeAggregateError, as I'd be happy to.

Yes, please. As you point out, only agoric-sdk should import from this package. If removing makeAggregateError does break any imports it will be valuable to find out.

@erights erights force-pushed the markm-deprecate-makeAggregateError branch from ebabe0d to 92a19a3 Compare April 22, 2024 18:03
@erights
Copy link
Member Author

erights commented Apr 22, 2024

Reviewers, please let me know if you'd prefer that I delete makeAggregateError, as I'd be happy to.

Yes, please. As you point out, only agoric-sdk should import from this package. If removing makeAggregateError does break any imports it will be valuable to find out.

Done

@erights erights added the automerge:squash Automatically squash merge label Apr 22, 2024
@mergify mergify bot merged commit c0e811e into master Apr 22, 2024
67 checks passed
@mergify mergify bot deleted the markm-deprecate-makeAggregateError branch April 22, 2024 19:04
mergify bot pushed a commit that referenced this pull request Jun 15, 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 pull request 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 pull request 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
automerge:squash Automatically squash merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants