speechmatics / speechmatics-js-sdk

Javascript and Typescript SDK for Speechmatics
MIT License
39 stars 4 forks source link

Calls to RealTime.stop() don't work unless the connection is established #46

Closed nickgerig closed 2 weeks ago

nickgerig commented 1 month ago

Describe the bug Requests to stop() which maps to stopRecognition() during the connecting phase, before the connection is established, are ignored. This can result in sessions connecting and staying open unintentionally.

https://github.com/speechmatics/speechmatics-js-sdk/blob/b7745ed346166b2122e356be9580dbf2e61a4036/src/realtime/handlers.ts#L95

Expected behavior stopRecognition() should always end a RealTime session regardless of connection phase or any other state.