nest icon indicating copy to clipboard operation
nest copied to clipboard

fix(core): let the middleware can get the params in the global prefix

Open CodyTseng opened this issue 2 years ago ā€¢ 1 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

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: #9776

What is the new behavior?

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

CodyTseng avatar Oct 10 '22 15:10 CodyTseng

Pull Request Test Coverage Report for Build 88e8b676-a087-4894-ad55-c3b4e77ab62f

  • 29 of 30 (96.67%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 92.997%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/microservices/server/server-kafka.ts 0 1 0.0%
<!-- Total: 29 30
Totals Coverage Status
Change from base Build 2f44b0f1-4e06-49ac-b845-35bef850e129: 0.03%
Covered Lines: 6401
Relevant Lines: 6883

šŸ’› - Coveralls

coveralls avatar Oct 10 '22 15:10 coveralls

Does this pull request fix the issue described in https://github.com/nestjs/nest/issues/8844#issuecomment-1315242129 by any chance? If not, can we please fix that bug in this PR please and add some tests? Please let me know if that's not possible and I'll create a separate issue and open a PR.

EDIT: here's the ticket in case you decide to fix the bug https://github.com/nestjs/nest/issues/10566

mareksuscak avatar Nov 15 '22 12:11 mareksuscak

@mareksuscak I think I can get this PR to fix https://github.com/nestjs/nest/issues/10566 with a few small tweaks. But I think this should be two different questions. I'm not sure if we need to open another PR.

CodyTseng avatar Nov 15 '22 14:11 CodyTseng

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [x] Bugfix
  • [ ] Feature
  • [x] 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: #9776

What is the new behavior?

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

kenji57775 avatar Nov 18 '22 22:11 kenji57775

@mareksuscak Hi, I tried to fix the issue described in https://github.com/nestjs/nest/issues/8844#issuecomment-1315242129 and added some tests in this PR. Iā€™d appreciate it if you have time to review the commit and give me some advice.

CodyTseng avatar Nov 19 '22 16:11 CodyTseng

Thanks for your useful suggestions, @thiagomini ! I will look carefully at your suggestions and optimize the code later.

CodyTseng avatar Nov 22 '22 01:11 CodyTseng

Hey @kamilmysliwiec , could you review this too?

thiagomini avatar Nov 25 '22 12:11 thiagomini

Apologies for not reviewing this PR sooner.. There's a few conflicts that occurred after we introduced a new PathsExplorer class https://github.com/nestjs/nest/blob/master/packages/core/router/paths-explorer.ts. Would you be able to resolve them @CodyTseng?

kamilmysliwiec avatar Feb 01 '23 12:02 kamilmysliwiec

Of course! I will resolve the conflict later.

CodyTseng avatar Feb 01 '23 13:02 CodyTseng

Hey @kamilmysliwiec, I've resolved conflicts. You can review it when you have time šŸ˜Š

CodyTseng avatar Feb 01 '23 15:02 CodyTseng

I'm wondering if this PR solves this issue https://github.com/nestjs/nest/issues/9990 as well šŸ¤”

kamilmysliwiec avatar Feb 03 '23 08:02 kamilmysliwiec

Unfortunately, this issue #9990 has not been solved in this PR.

I'm also following this issue, if I think of a suitable solution, I'd be happy to create a PR for it. I think the following method needs to be modified. https://github.com/nestjs/nest/blob/03efdce8d6bdbdd401f98399c833bfe62a413414/packages/core/middleware/utils.ts#L94-L111

CodyTseng avatar Feb 03 '23 08:02 CodyTseng

LGTM

kamilmysliwiec avatar Feb 03 '23 09:02 kamilmysliwiec