Skip to content
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

bugfix(microservices): pass all arguments to request-scoped proxies #2805

Merged
merged 5 commits into from
Aug 24, 2019
Merged

bugfix(microservices): pass all arguments to request-scoped proxies #2805

merged 5 commits into from
Aug 24, 2019

Conversation

Reasno
Copy link
Contributor

@Reasno Reasno commented Aug 24, 2019

Some microservices, such as gRPC, have more than one arguments in their
handler. Previously only the first argument, namely data itself, was passed
to the request-scoped proxies, stopping other arguments from propagating.

related to #2802

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #2802

What is the new behavior?

All arguments are passed into interceptors, pipes, etc.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@Reasno Reasno changed the title bugfix(microservice) pass all arguments to request-scoped proxies bugfix(microservice): pass all arguments to request-scoped proxies Aug 24, 2019
@Reasno Reasno changed the title bugfix(microservice): pass all arguments to request-scoped proxies bugfix(microservices): pass all arguments to request-scoped proxies Aug 24, 2019
@coveralls
Copy link

coveralls commented Aug 24, 2019

Pull Request Test Coverage Report for Build 4243

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 95.262%

Files with Coverage Reduction New Missed Lines %
packages/microservices/listeners-controller.ts 2 92.31%
Totals Coverage Status
Change from base Build 4230: 0.03%
Covered Lines: 3639
Relevant Lines: 3820

💛 - Coveralls

Some microservices, such as gRPC, have more than one arguments in their
handler. Previously only the first argument, namely data itself, was passed
to the request-scoped proxies, stopping other arguments from propagating.

Related to #2802
@Reasno
Copy link
Contributor Author

Reasno commented Aug 24, 2019

The previous test case has a false positive.

In "createRequestScopedHandler when 'loadPerContext' throws" branch, the exception is not triggered by "loadPerContext", but triggered by undefined "coreModuleRef" in private method "registerRequestProvider".

Without attempting to fix two things in one PR, I stubbed the registerRequestProvider and left it untested, only covering what I intended to fix.

@kamilmysliwiec kamilmysliwiec added this to the 6.6.0 milestone Aug 24, 2019
@kamilmysliwiec kamilmysliwiec changed the base branch from master to 6.6.0 August 24, 2019 17:40
@kamilmysliwiec kamilmysliwiec merged commit 34f4a84 into nestjs:6.6.0 Aug 24, 2019
@kamilmysliwiec
Copy link
Member

Thanks!

@lock
Copy link

lock bot commented Nov 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants