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

StreamingDetectIntent doesn't process audio after stream reset in node.js v14 & v16 #3539

Open
nishantt95 opened this issue Feb 2, 2022 · 0 comments
Labels
api: dialogflow Issues related to the Dialogflow API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@nishantt95
Copy link

This issue is in regards to this context googleapis/nodejs-dialogflow-cx#178

Environment details

  • OS: Windows 10. Debian 9 (stretch)
  • Node.js version: v14.16.0, v16.13.2
  • @google-cloud/dialogflow-cx version: 2.15.0

Issue
To process audio requests continuously, it was suggested to reset the detectStream/requestStream after receiving the response from Dialogflow CX server. This solution worked as expected for node.js v12. However, the same implementation failed for Node v14 & v16.

So, when we call detectStream.end() (in all Node.js versions), we do receive an end callback which means that it is ending the connection but when we recreate a detectStream object (in v14, v16) we don't receive any error but not even able to receive any response (transcription/audio response) for the audio request being sent. This same implementation works for v12.

Instead of calling detectStream.end(), I tried calling detectStream.cancel() and then recreated a detectStream object and now it is working as expected even for v14, v16. But in exchange we get a gRPC error "1 CANCELLED".

Now my question is:

  1. Why detectStream.end() is not working as expected in v14, v16 but works fine for v12?

  2. Is calling detectStream.cancel() is the right way to proceed?

For code snippet please refer here googleapis/nodejs-dialogflow-cx#178

@nishantt95 nishantt95 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 2, 2022
@product-auto-label product-auto-label bot added the api: dialogflow Issues related to the Dialogflow API. label Feb 2, 2022
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels May 4, 2022
@aribray aribray assigned dizcology and unassigned aribray Jul 6, 2022
@sofisl sofisl transferred this issue from googleapis/nodejs-dialogflow-cx Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dialogflow Issues related to the Dialogflow API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants