-
Notifications
You must be signed in to change notification settings - Fork 404
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: we have one failing test #243
Comments
I use node v8.1.4 and don't have any failing test. I think that the newest version of node have broken some internals API so we should try to update our dependencies to the newest versions. |
Here is the latest build: https://travis-ci.org/pleerock/routing-controllers/jobs/261758848 Our |
Ok, I've updated local node version and on v8.2.1 I have the test failing. But I have no idea why the socket hang, tried deps update but no success 😞 |
If this issue with |
😆 |
Just quickly looking at the issue, I found that commenting out line https://github.com/pleerock/routing-controllers/blob/master/src/driver/express/ExpressDriver.ts#L336 results in the test passing. |
No body is guilty of anything in OSS. 🙂 @pleerock simply said you should check it out because you wrote it, so probably you are the one who can find out where the issue commings from.
Thanks for looking into this @patrickhousley do you want to follow up on your findings and create a PR to fix it? |
Honestly, the fix would be to not call next if |
This is the actual PR that was merged into Node. |
@19majkel94 How would you like to proceed on this one. It seems it is going to need a, possibly drastic and breaking, change to the code base. |
I cannot find it now, but this was discussed. It is a needed bad coming from some implementation detail of the library.
Just +1 reason to rewrite the middleware execution. I think we should move forward with this after making our decision on #107, but that will need some more discussion. For now only @19majkel94 and me made our decision. |
After giving this a little more thought, I believe it is certainly possible that an error handler may send headers and still pass the error on (logging is an excellent example). We also cannot always assume that third party error handlers are not going to pass the error on to |
For now, anyone coming across this can use the below code to prevent the issue with the socket being closed. Make sure this is the last error handler added to the Express app.
Custom type definition to support access to
|
Nice found! For me this boils down to the same thing still, the same you mentioned. We should rethink how and where we call next and prevent calling it after the last middleware. |
Node v8.3.0 and still the same failing test problem 😢 |
Does anyone using sessions here? I just tested it seems the functionality is totally broken in express. |
So why the rest of session test cases doesn't fail? The only problem is that the serwer hang up when we want to load param from session ( |
I've found a simple solution for this bug (see 4b3f2e5). However, it conflicts with some assumptions (that Is this really needed? |
@fabiob The issue with the change you linked to is that custom error handlers will never be called. Honestly, I think the correct fix is to make the routing-controllers error handler the last handler to be called and then have it not pass the error on the the express error handler. |
@pleerock @NoNameProvided can we just comment the test case that fails? Until we found a fix for newest node issue we should disable it because it's easy to miss the not falsy-negative test like in #269 it took place. |
someone said its because of |
I can't confirm that, the problem may be that we send We should comment it until we fix it, there are many paralel PRs and features/fixes, not calling next = big changes in middlewares as I described in other issue. |
okay comment it, we should not have "build: failed" even few hours, but we had it for months... But dont forget to return back to that test and fix related issues later 😆 |
Looks so much better 😀 |
I dont like that we commented in, I bet on it it wont be fixed again. This way we lost coverage for a feature so now we can broke it for everyone without noticing. We should really dig and fix that. I would say I will give a try but I am so short on time nowadays because of coming releases that I barely have time to read through my notifications. |
Agree that we should not comment it, however having a build failed also not good and unfortunately looks like noone has time to fix it =( |
I bet that the problem is with default error handler which bubble the error so the session middleware is trying to react on the error but it is already handled. |
Stale issue message |
Closing as out-of-date. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
One of our test is failing in the last few commit. We should investigate and fix that.
The text was updated successfully, but these errors were encountered: