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

Not every object that has a subscribe method is an observable #8595

Closed
2 of 15 tasks
simhnna opened this issue Nov 15, 2021 · 0 comments · Fixed by #8851
Closed
2 of 15 tasks

Not every object that has a subscribe method is an observable #8595

simhnna opened this issue Nov 15, 2021 · 0 comments · Fixed by #8851
Labels
needs triage This issue has not been looked into

Comments

@simhnna
Copy link

simhnna commented Nov 15, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Code assumes results are observables based on the presence of a subscribe method

Minimum reproduction code

https://github.com/nestjs/nest/blob/master/packages/core/helpers/external-context-creator.ts#L332

Steps to reproduce

In our case we returned an AsyncIterator for a graphql subscription. The returned object had a private subscribe method and nest just assumed it was an observable.

Expected behavior

Code doesn't check for presence of a method to call a completely different method

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

No response

Packages versions

  • @nestjs/core 7.6.18

(current version should also be affected)

Node.js version

No response

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

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
1 participant