Open WesleyClements opened 2 years ago
Patch coverage: 100.00
% and no project coverage change.
Comparison is base (
bff06e9
) 100.00% compared to head (a4a8208
) 100.00%.:exclamation: Current head a4a8208 differs from pull request most recent head bd4772c. Consider uploading reports for the commit bd4772c to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
To address the issue outlined in #74 and the original ticket in the koa repo, I've refactored the recursion implementation to make it easier to keep track of whether or not next hasn't resolved. The fundamental thing I've done is to add a proxy for the next middleware that will note when the next dispatch call returns. If any given middleware calls next and resolves before it does we throw an error. Additionally I've stripped out all of the safeguards in production to slim the implementation even more. In production it won't be dissimilar to how things are already implemented. In development though, there will be an increase in memory footprint as, in addition to more variables, there will be an extra stack frame per middleware.