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

Wrong typings for MessageHandler #9668

Closed
3 of 15 tasks
dkonasov opened this issue May 25, 2022 · 3 comments · Fixed by #9674
Closed
3 of 15 tasks

Wrong typings for MessageHandler #9668

dkonasov opened this issue May 25, 2022 · 3 comments · Fixed by #9674
Labels
needs triage This issue has not been looked into

Comments

@dkonasov
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Return type of MessageHandler function is Promise<Observable<TResult>>, while actually it returns Promise<TResult>.

Minimum reproduction code

https://github.com/dkonasov/message-handler-typings-bug-demo/blob/b96262ee988bd62ab71f4dc6cbbfc996dcb1ab8b/src/demo-strategy.ts#L12

Steps to reproduce

No response

Expected behavior

Should be typed according to real return value

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

No response

NestJS version

8.4.5

Packages versions

platform-express version : 8.4.5
microservices version    : 8.4.5
schematics version       : 8.0.11
testing version          : 8.4.5
common version           : 8.4.5
core version             : 8.4.5
cli version              : 8.2.6

Node.js version

16.13.2

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@dkonasov dkonasov added the needs triage This issue has not been looked into label May 25, 2022
@kamilmysliwiec
Copy link
Member

Type should be Promise<Observable<TResult>> | Promise<TResult>. Would you like to create a PR for this issue?

@dkonasov
Copy link
Contributor Author

Type should be Promise<Observable<TResult>> | Promise<TResult>. Would you like to create a PR for this issue?

Yes, I'll create it in a next few days, thanks =)

@kamilmysliwiec
Copy link
Member

Let's track this here #9674

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants