-
-
Notifications
You must be signed in to change notification settings - Fork 689
fix(ws) onSocketClose being called multiple times #4632
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4632 +/- ##
==========================================
- Coverage 92.94% 92.92% -0.02%
==========================================
Files 106 106
Lines 33092 33086 -6
==========================================
- Hits 30756 30746 -10
- Misses 2336 2340 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Uzlopak
left a comment
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.
Instead of awaiting t.completed, you should await some resonable time like 250 ms.
Also dont use tspl, but use directly t.plan. tspl passes even if you have some asynchronous Activity after the test ended.
t.plan in node 20 works but does not have the waitFor option like in node 22+.
Uzlopak
left a comment
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
mcollina
left a comment
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
fixes #4628
closes #4631
isConnecting = state is 0 (CONNECTING)
onSocketClose sets state to 2 (CLOSING)
this way onSocketClose can only be called once
from #4631: