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.

When using a manually specified user id, bot emulator switches to user id r_[somenumber] after initial messages

See original GitHub issue

Version

4.8.1

Describe the bug

I set the emulator to use a custom user ID. It starts the conversation using that ID but after the initial messages from the bot it changes the user id to something like r_[somenumber].

To Reproduce

Steps to reproduce the behavior:

  1. Go to emulator settings
  2. Enable "Use your own user ID to communicate with the bot
  3. Copy dl_e9360b03-412d-4597-8046-be40264fdc51@demo_company in the User ID field
  4. Click save
  5. Restart conversation with the bot
  6. Inspect conversationUpdate to see that it adds member with id dl_e9360b03-412d-4597-8046-be40264fdc51@demo_company to conversation
  7. See that bot answers with some intro message. recipient.id should be dl_e9360b03-412d-4597-8046-be40264fdc51@demo_company
  8. Send a message to the bot. from.id should be dl_e9360b03-412d-4597-8046-be40264fdc51@demo_company but in my case it was r_1589199908. This breaks my bot logic.

Expected behavior

I expect the user ID to be the one I configured and I expect the user ID stay the same during the conversation.

Screenshots

image image

Additional context

conversationUpdate:

{
  "channelId": "emulator",
  "conversation": {
    "id": "73bcb540-9382-11ea-8641-f9e1905c9a85|livechat"
  },
  "from": {
    "id": "dl_e9360b03-412d-4597-8046-be40264fdc51@demo_company",
    "name": "User",
    "role": "user"
  },
  "id": "73ce1a60-9382-11ea-a0f0-e59eeb591f47",
  "localTimestamp": "2020-05-11T14:25:08+02:00",
  "membersAdded": [
    {
      "id": "35afd9d0-9382-11ea-8641-f9e1905c9a85",
      "name": "Bot"
    },
    {
      "id": "dl_e9360b03-412d-4597-8046-be40264fdc51@demo_company",
      "name": "User"
    }
  ],
  "membersRemoved": [],
  "recipient": {
    "id": "35afd9d0-9382-11ea-8641-f9e1905c9a85",
    "name": "Bot",
    "role": "bot"
  },
  "serviceUrl": "http://localhost:53051",
  "timestamp": "2020-05-11T12:25:08.614Z",
  "type": "conversationUpdate"
}

message from bot: “How can I help you?”

{
  "attachments": [],
  "channelId": "emulator",
  "conversation": {
    "id": "73bcb540-9382-11ea-8641-f9e1905c9a85|livechat"
  },
  "entities": [],
  "from": {
    "id": "35afd9d0-9382-11ea-8641-f9e1905c9a85",
    "name": "Bot",
    "role": "bot"
  },
  "id": "79fb3800-9382-11ea-a0f0-e59eeb591f47",
  "inputHint": "expectingInput",
  "localTimestamp": "2020-05-11T14:25:18+02:00",
  "recipient": {
    "id": "dl_e9360b03-412d-4597-8046-be40264fdc51@demo_company",
    "role": "user"
  },
  "replyToId": "73ce1a60-9382-11ea-a0f0-e59eeb591f47",
  "serviceUrl": "http://localhost:53051",
  "speak": "Waar kan ik je mee helpen?",
  "text": "Waar kan ik je mee helpen?",
  "timestamp": "2020-05-11T12:25:18.976Z",
  "type": "message"
}

question containing issue: question from user to bot, where emulator seems to have wrong from.id

{
  "channelData": {
    "clientActivityID": "1589199932491y4w38xfucw",
    "clientTimestamp": "2020-05-11T12:25:32.491Z"
  },
  "channelId": "emulator",
  "conversation": {
    "id": "73bcb540-9382-11ea-8641-f9e1905c9a85|livechat"
  },
  "entities": [
    {
      "requiresBotState": true,
      "supportsListening": true,
      "supportsTts": true,
      "type": "ClientCapabilities"
    }
  ],
  "from": {
    "id": "r_1589199908",
    "name": "User",
    "role": "user"
  },
  "id": "820a8320-9382-11ea-a0f0-e59eeb591f47",
  "localTimestamp": "2020-05-11T14:25:32+02:00",
  "recipient": {
    "id": "35afd9d0-9382-11ea-8641-f9e1905c9a85",
    "name": "Bot",
    "role": "bot"
  },
  "serviceUrl": "http://localhost:53051",
  "text": "waar werk ik?",
  "textFormat": "plain",
  "timestamp": "2020-05-11T12:25:32.498Z",
  "type": "message"
}

[bug]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
hansmbakkercommented, May 14, 2020

Yes, I believe so

1reaction
hansmbakkercommented, May 14, 2020

Hi @tonyanziano,

  • the pattern I saw was not r_<guid> but r_<integer> (you can see it in the json marked as “question containing issue”
  • I did restart conversation - new user id
  • I did not try changing the user id of an existing conversation. The issue is, that the emulator seemed to change the users id from <custom id> to r_<integer> after a few messages in the conversation
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Bot Framework Authentication - Bot Service
Learn how to troubleshoot bot authentication errors, such as connectivity issues and problems with app IDs and passwords.
Read more >
How to send specific user ID from bot framework emulator v4?
The short answer is, if you are using Direct Line to generate a token from a secret and you specify user Id there...
Read more >
Connecting Bot Framework to Azure Cosmos DB - YouTube
In this part, we will be connecting our bot with Azure Cosmos DB. For not to incur any charges for Azure Cosmos DB,...
Read more >
Step by Step: Configure Bot to Work in Teams and with ...
Let's publish all the changes to Azure so we could use them later on from MS Teams. Add Microsoft Teams Channel to the...
Read more >
Build a Doctor Appointment Bot with Azure Bot Service ... - Twilio
Learn how to build an SMS booking system using Twilio, Azure Bot ... and use the value from the Name column to specify...
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