Invoke: healthCheck activity will throw on DirectLine Speech
See original GitHub issueVersions
What package version of the SDK are you using. 4.9.3 What nodejs version are you using 12.16.1 (but irrelevant to this bug) What browser version are you using irrelevant What os are you using irrelevant
Describe the bug
An invoke activity with the name healthCheck will fail on DirectLine Speech on this line: https://github.com/microsoft/botbuilder-js/blob/1908c683c3fc9c74260fb26494c9da4c4a3169f3/libraries/botbuilder/src/botFrameworkAdapter.ts#L1385
(TypeError: Cannot read property 'credentials' of undefined
)
context.turnState.get(this.ConnectorClientKey)
is gonna be undefined
for a WebSocket connection as processActivity
is never gonna be called, where this value is set.
To Reproduce
Send a {"type": "invoke", "name": "healthCheck"}
to any bot written in JS and observe the error.
Expected behavior
Check for undefined
on getting the connectorClient
from turnState
first.
Screenshots
Additional context
[bug]
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (20 by maintainers)
@stevengum
So, we’re only interested in a DLS check, yes. We’ve had an outage recently where all of our backend was healthy but the DLS connection didn’t work after an SSL and private key update on the Bot Service side. We received WebSocket connectsions, but they failed to finish establishing, which such a healthcheck would have alerted on.
@johnataylor yes, that’s the gist of it. We started looking into this kind of healthcheck and before defining a custom activity type, we investigated and found that the botbuilder SDK already supports such a type and “invoke” sounds like the right solution for this anyways, so we wanted to continue using an existing “standard”.