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.

First activity will have a bogus replyToId if it was from the bot

See original GitHub issue

Version

master (as of pre-R12)

Describe the bug

Although this is a SDK bug, I am filing it here because we have // TODO code to remove after that bug is fixed.

First activity will have a bogus replyToId if it was from the bot.

If this bug is not fixed, it might cause accessibility issues on our side.

  • When the bot is sending the very first activity in the conversation, that activity always have a bogus replyToId
    • The replyToId has a value, but the value is random string, and it refer to an activity that never exists in the world
  • SDK team should remove the replyToId as the value is not a valid
    • This is the root cause of #3431, the PR I did is to workaround their bug, and introduced a new but less severe issue
    • If we don’t remove replyToId in SDK and keep the workaround in #3431, it will cause issue in this scenario:
      • If both user and bot send activities to each other immediately after connect, the order of the message could be different: what the user see, and what they hear through screen reader, will be different
      • IMO, this issue is less severe than a 5s delay, so I prefer we implement this workaround in the mean time

Steps to reproduce

  1. Edit /__tests__/html/accessibility.delayActivity.withReplyToId.html
  2. Remove the // TODO line related to this bug
  3. Run the test

Expected behavior

It should succeed, reasons:

  • The user sent the activity “Hello, World!”
  • ABS did not send us the activity ID yet for the “Hello, World!” activity
  • The bot (thru ABS) already sent us the reply, “You said, …”, with a replyToId pointing to “Hello, World!”
  • Since the activity that replyToId is pointing to, is not known yet, the bot reply “You said, …” should not appear on the transcript

To fix #3431, we have to relax the delay for the very first bot message, since it may have a bogus ID, or it may have a valid ID, we can’t tell whether the replyToId is valid or not. We assume the first one is bogus, so we don’t add 5 seconds delay.

But that PR inevitably introduced another accessibility issue, which is less severe, IMO.

The // TODO line is to send a bot activity first, so the bot reply, “You said, …” activity, is no longer the first bot activity, and it should subject to delay.

Additional context

Developers who are not familiar with how ABS works and how it order messages, should read this sequence diagram first.

https://github.com/microsoft/BotFramework-WebChat/blob/master/docs/media/direct-line-sequence-diagram.png

For accessibility, the order of the narration is based on time when we add the element to the tree. And not based on the actual position of the element in the tree.

[Bug]

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mrivera-mscommented, Mar 12, 2021

@Kaiqb, I have added the issue that will track this in the dotnet repo.

1reaction
Kaiqbcommented, Mar 12, 2021

Link to the issue Monica created in dotnet repo: Issue #5310: First activity has fake replyToId value that is causing a bug in WebChat. We’ll leave this issue open here because we’ll have to remove code after the bug is fixed in the SDK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot create property 'replyToId' when chatbot reply ...
In my case it was because of the content-type header, it needs to be set "Content-Type: application/json". Let me show what I was...
Read more >
Bot Framework Connector service REST API reference
When a user sends a message to your bot, the incoming request contains an Activity object with a serviceUrl property that specifies the...
Read more >
2021 - Vardhaman Deshpande
Building a Microsoft Teams Bot: Posting an Adaptive Card carousel as a ... If this is the first time logging into this tenant,...
Read more >
Saving Bot Activities in Azure SQL Database - Bot Framework
If you are using Azure Sql Server (as this example is), you might need to add your IP address to the firewall. It...
Read more >
Conversation Builder — Get & Set Session Data
Bot variables that are not set will return NULL. ... If false, the variable is treated as a request variable, which means the...
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