You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am creating an activity the posting it into my bot. Unfortunately it looks like the ID that I provide the activity does not match the ID displayed in the JSON inspector.
The JSON is:
{
"attachments": [
{
"content": {
"buttons": [
{
"text": "PositiveFeedback|question:what is a skill|answer:A broad set of common capabilities exist which today, which require each developer to build themselves. Our Virtual Assistant solution includes a new Skill capability enabling new capabilities to be plugged into an Virtual Assistant through configuration only and provide an authentication mechanism for Skills to request tokens for down-stream activities.\nFind out more [here](https://github.com/Microsoft/AI/blob/master/solutions/Virtual-Assistant/docs/virtualassistant-skills.md).|activityid:f371dc50-8318-11e9-a9a4-4fbd3b8d2732|channelid:emulator",
"title": "Yes",
"type": "imBack",
"value": "PositiveFeedback|question:what is a skill|answer:A broad set of common capabilities exist which today, which require each developer to build themselves. Our Virtual Assistant solution includes a new Skill capability enabling new capabilities to be plugged into an Virtual Assistant through configuration only and provide an authentication mechanism for Skills to request tokens for down-stream activities.\nFind out more [here](https://github.com/Microsoft/AI/blob/master/solutions/Virtual-Assistant/docs/virtualassistant-skills.md).|activityid:f371dc50-8318-11e9-a9a4-4fbd3b8d2732|channelid:emulator"
},
{
"text": "NegativeFeedback|question:what is a skill|answer:A broad set of common capabilities exist which today, which require each developer to build themselves. Our Virtual Assistant solution includes a new Skill capability enabling new capabilities to be plugged into an Virtual Assistant through configuration only and provide an authentication mechanism for Skills to request tokens for down-stream activities.\nFind out more [here](https://github.com/Microsoft/AI/blob/master/solutions/Virtual-Assistant/docs/virtualassistant-skills.md).|activityid:f371dc50-8318-11e9-a9a4-4fbd3b8d2732|channelid:emulator",
"title": "No",
"type": "imBack",
"value": "NegativeFeedback|question:what is a skill|answer:A broad set of common capabilities exist which today, which require each developer to build themselves. Our Virtual Assistant solution includes a new Skill capability enabling new capabilities to be plugged into an Virtual Assistant through configuration only and provide an authentication mechanism for Skills to request tokens for down-stream activities.\nFind out more [here](https://github.com/Microsoft/AI/blob/master/solutions/Virtual-Assistant/docs/virtualassistant-skills.md).|activityid:f371dc50-8318-11e9-a9a4-4fbd3b8d2732|channelid:emulator"
}
],
"subtitle": "",
"title": "Click on the icons below to rate this answer"
},
"contentType": "application/vnd.microsoft.card.hero"
}
],
"channelId": "emulator",
"conversation": {
"id": "74aa38f1-8317-11e9-996c-452966995099|livechat"
},
"entities": [],
"from": {
"id": "67a0a4f0-8295-11e9-996c-452966995099",
"name": "Bot",
"role": "bot"
},
"id": "ef945e90-8319-11e9-a9a4-4fbd3b8d2732",
"localTimestamp": "2019-05-31T08:31:42+12:00",
"locale": "en-US",
"recipient": {
"id": "9c25fbce-849f-41e7-adf8-218bc84d1925",
"role": "user"
},
"replyToId": "f371dc50-8318-11e9-a9a4-4fbd3b8d2732",
"serviceUrl": "http://localhost:62661",
"timestamp": "2019-05-30T20:31:42.841Z",
"type": "message"
}
This activity is being created by the following code:
public static Activity GetHeroCardWithButtons(string cardTitle, List<HeroCardButton> buttons)
{
var chatActivity = Activity.CreateMessageActivity();
var cardButtons = new List<CardAction>();
foreach (HeroCardButton button in buttons)
{
cardButtons.Add(
new CardAction()
{
Text = button.Value,
Type = ActionTypes.ImBack,
Title = button.Label,
Value = button.Value
//Value = " " // Thank you for your feedback here?
});
;
}
var plCard = new HeroCard()
{
Title = cardTitle,
Subtitle = string.Empty,
Buttons = cardButtons
};
var attachment = plCard.ToAttachment();
chatActivity.Id = Guid.NewGuid().ToString();
chatActivity.Attachments.Add(attachment);
return (Activity)chatActivity;
}
Evidence of the ID being created in code for the activity:
Checking the activity in the emulator:
Am I doing something wrong here when trying to find the activity ID?
Thanks.
Additional context
I am trying to use the activity id to Call the DeleteActivityAsync function but since the IDs don't match it fails.
The text was updated successfully, but these errors were encountered:
I've found the code responsible for this issue, and it appears that the Emulator is in fact overwriting the id field on the incoming activity.
I don't think this is necessary because if you look at that same code path, we call postActivityToUser which then calls postage on the activity, which tries to use the existing id on the activity, otherwise it generates a new one. In the case of this code path, we are wiping the incoming id field every time, so a new GUID is always generated.
@justinwilaby or @compulim do either of you happen to have more context on this, or any idea on if this is necessary? If not, it should be an easy fix of just reusing the incoming activity's id or defaulting to null if the id field is missing.
I discussed this change with @compulim offline, and we have decided that there shouldn't be any adverse side effects to this change as long as you -- the user -- ensure that the activity ids are unique.
At that point the burden is on the user when modifying the activity id directly.
Version
4.4.2
Describe the bug
I am creating an activity the posting it into my bot. Unfortunately it looks like the ID that I provide the activity does not match the ID displayed in the JSON inspector.
The JSON is:
This activity is being created by the following code:
Evidence of the ID being created in code for the activity:
Checking the activity in the emulator:
Am I doing something wrong here when trying to find the activity ID?
Thanks.
Additional context
I am trying to use the activity id to Call the DeleteActivityAsync function but since the IDs don't match it fails.
The text was updated successfully, but these errors were encountered: