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

feat: do not interfere with shared workers #1448

Merged
merged 4 commits into from Nov 7, 2022

Conversation

mucsi96
Copy link
Contributor

@mucsi96 mucsi96 commented Nov 3, 2022

Here I am adding support for shared workers.

The issue is that in case of shared workers the request event doesn't contain clientId.
Due to that the client is undefined which breaks the code here

if (client.frameType === 'top-level') {
    return client
  }

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 3, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7d7f7d1:

Sandbox Source
MSW React Configuration

kettanaito
kettanaito previously approved these changes Nov 3, 2022
Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

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

This looks fantastic! Thank you for adding this support, @mucsi96 🎉

Let me try this out and get back to you.

@kettanaito kettanaito changed the title Add support for shared workers fix: do not interfere with shared workers Nov 3, 2022
@kettanaito kettanaito changed the title fix: do not interfere with shared workers feat: do not interfere with shared workers Nov 3, 2022
@kettanaito
Copy link
Member

I'd like to group this with #1445 since both changes are potentially breaking and would fall nicely into a single minor release.

@kettanaito kettanaito merged commit 670dda7 into mswjs:main Nov 7, 2022
@kettanaito
Copy link
Member

Released: v0.48.0 🎉

This has been released in v0.48.0!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't handle requests from a shared worker can't handle request for shared workers
2 participants