-
Notifications
You must be signed in to change notification settings - Fork 61
Use cloneable abort reason for shared sync port close #810
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 4c2ea53 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Could you please add more context for the issue this PR is trying to solve. Specifically the error you were observing before these changes. From a quick refresher on the code. The abort reason is used to when aborting the I haven't attempted to reproduce the issue this PR is trying to solve, but believe general cloning of unserializable Errors should be handled in #786 which will be merged and released soon.
|
|
Saw DataCloneError while digging into #808. The only value that is directly set in that teardown path is the abort reason Based on my understanding, the path this targets (fetchCredentialsController):
|
I see. The serialization in IMO, a nicer fix is to pair sending the fetchCredentials: async () => {
const lastPort = await this.getLastWrappedPort();
if (!lastPort) {
throw new Error('No client port found to fetch credentials');
}
return new Promise(async (resolve, reject) => {
const abortController = new AbortController();
this.fetchCredentialsController = {
controller: abortController,
activePort: lastPort
};
- abortController.signal.onabort = reject;
+ abortController.signal.onabort = () => {
+ reject(abortController.signal.reason);
+ }; |
Summary
Changes
shared_sync_abort_reason.test.tscover fetch-credentials and upload abort paths.Tests