unregister "unhandled" event when socket is closed#224
unregister "unhandled" event when socket is closed#224shellscape merged 1 commit intoshellscape:masterfrom
Conversation
This addresses the Memory Leak warning mentioned in shellscape#223
|
Ah, you've put it at the top. Please give attention to PR templates, I wasn't expecting there to be info outside of the |
|
I'll fix the description and see if i can add a test for this. |
|
@serkanyersen ping |
|
@serkanyersen last ping before I mark this one as abandoned |
|
Hi, I just checked this again, but I'm not sure what kind of test can be written for this 🤔 I've checked the https://github.com/shellscape/webpack-plugin-serve/blob/master/test/routes.test.js but that test appears to be empty, to test this one would have to start the server, reload the page 5 to 10 times and some how read the warning [not] thrown by nodejs. codecov shows that coverage for routes.js has dropped, this is possibly due to other tests that use this code, but I'm not sure how to explore this path, it might be as simple as remaking the request to localhost one more time in a test for example in https.test.js . I'm looking for your guidance on this one. This fix is definitely needed though, we have been using this as a patch since May and no issues have been reported by the team, so it seems safe. Let me know how you want to proceed. |
|
We also experienced this problem and would be happy when it will be merged to master and released. |
|
@Splurov perhaps you could assist in creating a test for this change |
|
@shellscape I'll write some tests for this feature if you will give some guidance on how you'd like it to be setup. At first glance, it appears the that "routes" part of this lib has no tests at all. |
|
Ah shit, yeah. I got lazy with the tests for routes, and when I made that comment about adding tests, I didn't put two and two together. No worries, we'll YOLO this out next week and see how it goes. |
This PR contains:
Breaking Changes?
If yes, please describe the breakage.
Please Describe Your Changes
I'm unsubscribing from this event whenever the socket is closed.
This addresses the Memory Leak warning mentioned in #223