-
Notifications
You must be signed in to change notification settings - Fork 563
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: handle websocket closed correctly #3565
Conversation
Co-authored-by: eXhumer <[email protected]>
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.
LGTM
Related issue needs to be re-opened as I don't think issue is fixed. Infact, the test was modified which doesn't check the close event firing. Issue re-producible with the following code import { WebSocket } from 'undici';
const ws = new WebSocket('ws://localhost:8080');
ws.onclose = e => {
console.log('close', e);
};
ws.onerror = e => {
console.log('error', e);
}; Console output
|
const { tspl } = require('@matteo.collina/tspl') | ||
|
||
test('first error than close event is fired on failed connection', async (t) => { | ||
const { completed, strictEqual } = tspl(t, { plan: 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.
{ plan: 2 }
skips close
event check
Test output with fixed websocket test.
|
* see #3546, #3548 & #3565 Signed-off-by: eXhumer <[email protected]>
Fixes #3546
Closes #3548