-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
fix(WebSocket): make MessageEvent cancelable #506
Conversation
kettanaito
commented
Feb 15, 2024
- See MessageEvent cannot be prevented even if cancelable is true nodejs/node#51767
"undici": "^6.5.0", | ||
"vitest": "^0.28.5", | ||
"undici": "^6.6.2", | ||
"vitest": "^1.2.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating vitest has broke a few tests that were using .toContain()
for partial object assertions. The behavior of that matcher seemed to have changed across Vitest releases.
I've changed the tests to use .toMatchObject()
.
* | ||
* @see https://github.com/nodejs/node/issues/51767 | ||
*/ | ||
export class CancelableMessageEvent<T = any> extends MessageEvent<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something we need to remove in the future.
TL;DR Node's MessageEvent
cannot be canceled. Doesn't respect the cancelable
attribute and so preventDefault()
does nothing. Looks like a bug in Node.js. Reported.
Released: v0.26.2 🎉This has been released in v0.26.2! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |