BotFramework-WebChat: oAuthcard | botframework-webchat & Enhanced authentication. 4 seconds delay due to Timeout queueIncomingActivitySaga

Is it an issue related to Adaptive Cards?

No

Is this an accessibility issue?

No

What version of Web Chat are you using?

Latest production (4.16.0)

Which distribution are you using Web Chat from?

Unrelated

Which hosting environment does this issue primarily affect?

Web apps

Which browsers and platforms do the issue happened?

Others or unrelated

Which area does this issue affect?

Attachment: OAuth card

What is the public URL for the website?

No response

Please describe the bug

After the authentication process of the oAUTH card finishes, there is a long delay before the next messages are rendered. I was able to reproduce it using the sample 18. not-authentication using NodeJS and bot emulator.

Do you see any errors in console log?

queueIncomingActivitySaga.js:178 botframework-webchat: Timed out while waiting for activity "60fb1610-b9d3-11ee-9214-55ee94be6ec6" which activity "60fc9cb0-b9d3-11ee-9214-55ee94be6ec6" is replying to. {activity: {…}, replyToId: "60fb1610-b9d3-11ee-9214-55ee94be6ec6"}activity: {type: "message", serviceUrl: "http://localhost:52975", channelId: "emulator", from: {…}, conversation: {…}, …}replyToId: "60fb1610-b9d3-11ee-9214-55ee94be6ec6"__proto__: Object
(anonymous) @ queueIncomingActivitySaga.js:178
u @ runtime.js:63

How to reproduce the issue?

I used Node v16.16.0 Emulator is 4.14.1 Also testen with latest production release [4.16.0]

Follow all steps for javascript in Add authentication to a bot Press login and enter your details. When login is succesfull you will notice that the message activities You are now logged in and the other arrive right away but are rendered only 4 seconds later In the console you will see the messages mentioned above

What do you expect?

I expect the message activities to be rendered right away The current behavior results in users clicking on the login button multiple time and expecting the authentication failed.

What actually happened?

When login is succesfull it takes another 4 seconds or so before new activities are rendered

Do you have any screenshots or recordings to repro the issue?

No response

Adaptive Card JSON

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 17

Most upvoted comments

Some additional information. This behavior (the 4 second delay) does not occur without advanced authentication enabled in the directLine channel. WHen the authentication code is entered by the user, the next step in the waterfall is executed instantly. But asking users to enter a code after they have used an authentication device (in our case) is also not a good user experience

@HesselWellema to me this issue doesn’t look like the WebChat issue as we are not able to influence the generation of the non-existent or malformed replyToId ids. I suppose we also won’t be able to filter out ids which may not correspond to any activity as different bot implementations may have different id values generation patterns which would limit WebChat usage and likely introduce new bugs.

I think Bot Framework SDK shouldn’t send the malformed or non-existent ids in the replyToId field in the first place. The field is designed to carry information regarding related activity in the current conversation and can be omitted according to the spec. As the wrong ids comes from the bot which is using Bot Framework SDK for JavaScript, I suppose the issue may have a fix on their end.

I wasn’t able to track down the issue in the repo though. All uses of replyToId seen are referencing the activity, so there may be something else involved.

@HesselWellema - Regarding testing, have you only tested this in Emulator? I see you mention having used the latest production release (v4.16.0). Does that mean you tested with one of the Web Chat samples? If so, could you tell me which one and/or could you share a copy of your Web Chat code? I just want to attempt a repro as closely to your setup as possible.

As for Emulator, are you utilizing ngrok at all (configured within the app or without)?