question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invoke: healthCheck activity will throw on DirectLine Speech

See original GitHub issue

Versions

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:closed
  • Created 3 years ago
  • Comments:21 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
alopixcommented, Jul 30, 2020

@stevengum

  1. I’m not sure this is true. I’ve yet to see this error to happen on establishing the connection when the bot is not available. The connection claims to be up but only sending an activity will sometimes result in the connection to be dropped/disconnected (using the JS Speech SDK in any case).
  2. We wouldn’t check if the web app is alive, as this is done via a separate app health check.

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.

1reaction
alopixcommented, Jul 31, 2020

@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”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

health check - Asp.net core healthchecks randomly fails with ...
When I hit healtchecks many times (simple F5 in browser) it throws the exception. Looks like you can't hit /health endpoint before previous ......
Read more >
Receive activities from the bot in Direct Line API 3.0
Using the Direct Line 3.0 protocol, clients can receive activities via WebSocket stream or retrieve activities by issuing HTTP GET requests.
Read more >
cPE - River Thames Conditions - Environment Agency - GOV.UK
Sportsman tournament 214 bay, Will smith ft dj jazzy jeff, Mychild app? ... Nizar jamaluddin 2015, Binary domain reviews on the run, Valacca...
Read more >
Word - West Virginia Secretary of State
This rule should be read in conjunction with the provisions of West ... activity is faster than a slow walk, but still allows...
Read more >
Standard Authorization Form
When you enroll under Health Check HSA, you will be given information to help you ... Benefits for Speech Therapy are limited to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found