microsoft / botbuilder-v3 Goto Github PK
View Code? Open in Web Editor NEWMicrosoft Bot Builder V3 SDK for Microsoft Bot Framework
License: MIT License
Microsoft Bot Builder V3 SDK for Microsoft Bot Framework
License: MIT License
The daily build is not properly following semver rules.
Attemping to build a "-preview" release incorrectly stamps the package version into the assemblyinfo files as the assembly versions. The build then fails, as assembly versions need to be 1.2.3.4 format.
Also, the build should allow the "Exact Version" semantics the C# v4 builds use.
Im using Azure to develop my bot. Im trying to create a bot using LUIS where if i ask it for a scan, it should give me back four types of analysis for a scan for eg: metrology, porosity, reverse engineering and wall thickness. Then i can choose an option form it.I feel like this is a very easy thing to do but im very new to computer programming, node.js. and bots.
This is how far ive gotten, i dont know how to progress from here,
code:
bot.dialog('CT scan',
(session) => {
session.send('You asked for a CT scan', session.message.text);
session.endDIalog();
}
).triggerAction({
matches: 'CT scan'
})
I also found this on another page in this forum. Can i implement this code in my code to get the result i want and how do i do it?
code:
===================================================================
var DialogLabels = {
Hotels: 'Hotels',
Flights: 'Flights',
Support: 'Support'
};
var bot = new builder.UniversalBot(connector, [
function (session) {
// prompt for search option
builder.Prompts.choice(
session,
'Are you looking for a flight or a hotel?',
[DialogLabels.Flights, DialogLabels.Hotels],
{
maxRetries: 3,
retryPrompt: 'Not a valid option'
});
},
function (session, result) {
if (!result.response) {
// exhausted attemps and no selection, start over
session.send('Ooops! Too many attemps :( But don\'t worry, I\'m handling that exception and you can try again!');
return session.endDialog();
}
// on error, start over
session.on('error', function (err) {
session.send('Failed with message: %s', err.message);
session.endDialog();
});
// continue on proper dialog
var selection = result.response.entity;
switch (selection) {
case DialogLabels.Flights:
return session.beginDialog('flights');
case DialogLabels.Hotels:
return session.beginDialog('hotels');
}
}
]);
I'am trying to publish my bot. During test ping request I get InternalServerError. The connector client makes POST request on https://dev.botframework.com/v3/conversations/test/activities but instead of json it gets some html.
So app throws Newtonsoft.Json.JsonReaderException:
Unable to deserialize the response. Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
Bot works properly in unpublished Skype and Web Chat channels.
Here's call stack:
Microsoft.Rest.SerializationException:
at Microsoft.Bot.Connector.Conversations+<SendToConversationWithHttpMessagesAsync>d__7.MoveNext (Microsoft.Bot.Connector, Version=3.15.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.Bot.Connector.ConversationsExtensions+<SendToConversationAsync>d__5.MoveNext (Microsoft.Bot.Connector, Version=3.15.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at SoftServe.ThinkIterateDeliver.BotServiceApp.BL.Implementation.ActivityDispatcher+<ProcessActivity>d__4.MoveNext (SoftServe.ThinkIterateDeliver.BotServiceApp.BL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullSoftServe.ThinkIterateDeliver.BotServiceApp.BL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: C:\Build\Agent_06\11\s\SoftServe.ThinkIterateDeliver.BotServiceApp.BL\Implementation\ActivityDispatcher.csSoftServe.ThinkIterateDeliver.BotServiceApp.BL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: 54)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at SoftServe.ThinkIterateDeliver.BotServiceApp.Web.Controllers.Api.InteractionController+<ProcessMessage>d__2.MoveNext (SoftServe.ThinkIterateDeliver.BotServiceApp.Web, Version=1.0.0.1, Culture=neutral, PublicKeyToken=nullSoftServe.ThinkIterateDeliver.BotServiceApp.Web, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null: C:\Build\Agent_06\11\s\SoftServe.ThinkIterateDeliver.BotServiceApp.Web\Controllers\Api\InteractionController.csSoftServe.ThinkIterateDeliver.BotServiceApp.Web, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null: 35)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+TaskOfIActionResultExecutor+<Execute>d__0.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Threading.Tasks.ValueTask1.get_Result (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.ValueTaskAwaiter1.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+<InvokeActionMethodAsync>d__12.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+<InvokeNextActionFilterAsync>d__10.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow (Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next (Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+<InvokeInnerFilterAsync>d__13.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeNextExceptionFilterAsync>d__24.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
Inner exception Newtonsoft.Json.JsonReaderException handled at Microsoft.Bot.Connector.Conversations+<SendToConversationWithHttpMessagesAsync>d__7.MoveNext:
at Newtonsoft.Json.JsonTextReader.ParseValue (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
at Newtonsoft.Json.JsonTextReader.Read (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
at Newtonsoft.Json.JsonReader.ReadForType (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed)
at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject (Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
at Microsoft.Bot.Connector.Conversations+<SendToConversationWithHttpMessagesAsync>d__7.MoveNext (Microsoft.Bot.Connector, Version=3.15.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
From @LlewellynJones on October 25, 2018 17:53
Microsoft.Bot.Builder {3.15.3}
Microsoft.Bot.Connector {3.15.3}
I am not experiencing any issues on my localhost without authentication, but after the app has been uploaded to Azure user's experience the "sorry my bot code is having an issue" error when starting the app. The error is logged as follows:
Microsoft.Bot.Connector.ErrorResponseException | Operation returned an invalid status code 'Unauthorized' |
---|
Open Skype and start a conversation or restart a conversation with bot framework app. The error also happens using webchat.
Start conversation without error
[bug]
Copied from original issue: microsoft/botbuilder-dotnet#1061
Dotnet SDK
Javascript SDK
Hi
Will the new BotFramework V3 support WhatsApp too?
Thank you!
From @rwmb on August 28, 2018 13:21
Botbuilder is sending multiple responses from the same request. When we send a message to the handler, it first sends a 202 (accepted) and then tries to send the response that the user requested (the handled message). This breaks the HTTP standard and prevents me from using botbuilder with Google Cloud Functions, because the first response stops the execution of the function (expected behavior). I've already created issues on firebase, google cloud platform, botframework and stack overflow, but as I imagined and as everyone suggested, the problem is the non-standard and unexpected behavior of the package.
Copied from original issue: microsoft/botbuilder-js#379
Is it possible to send a message to a specific Skype Account using nodejs?
Example: I'm trying to send a message to a specific Skype account (Person 2) if my bot does not have the answer. Then, catch again the answer to resend to the first user (Person 1).
I'm using NodeJs v8.12, and BotBuilder v4
Thanks
V3
I'm using the ActivityType Conversation Update to send a welcome message to the user.
This was working fine until now, where the bot doesn't send the message the first time anymore. (Neither on the Emulator or in the Web Chat)
This is the code
else if (messageType == ActivityTypes.ConversationUpdate)
{
// Handle conversation state changes, like members being added and removed
// Use Activity.MembersAdded and Activity.MembersRemoved and Activity.Action for info
// Not available in all channels
IConversationUpdateActivity iConversationUpdated = message as IConversationUpdateActivity;
if (iConversationUpdated != null)
{
ConnectorClient connector = new ConnectorClient(new System.Uri(message.ServiceUrl));
foreach (var member in iConversationUpdated.MembersAdded ?? System.Array.Empty<ChannelAccount>())
{
// if the bot is added, then
if (member.Id == iConversationUpdated.Recipient.Id)
{
var reply = ((Activity)iConversationUpdated).CreateReply(Properties.Messages.welcome_message);
await connector.Conversations.ReplyToActivityAsync(reply);
}
}
}
}
When I run the bot on the Emulator and debug the code, it looks like it works fine but no message is sent on the emulator.
When I reload the bot on the emulator (not restarting the app, just clicking on the reload button), the message is sent correctly.
The same behavior happens on the DirectLine (when loading the page the first time, nothing happens, but after reloading, the message is sent correctly.)
How can I fix this?
Thanks!
[bug]
[dotnet]
bot builder V3.15.2.2
Using the bot framework V3.15.2.2, I send a List Template to Face book by ChannelData, but it is failed, and I get the exception of [Operation returned an invalid status code 'BadRequest'] .
But I send the Json by curl, it was successful.
`
RootDialog.cs
public virtual async Task ChoiceReceivedAsync(IDialogContext context, IAwaitable<Object> activity)
{
var message = context.MakeMessage();
message.ChannelData = getListTemplate();
await context.PostAsync(message);
}
private object getListTemplate()
{
ListMessenger fbmsg = new ListMessenger();
fbmsg.ChannelData =
new ListMessengerChannelData
{
notification_type = "NO_PUSH",
attachment = new ListMessengerAttachment { payload = new ListMessengerPayload()}
};
fbmsg.ChannelData.attachment.type = "template";
fbmsg.ChannelData.attachment.payload.template_type = "list";
fbmsg.ChannelData.attachment.payload.top_element_style = "compact";
List<ListMessengerElement> e = new List<ListMessengerElement>();
e.Add(new ListMessengerElement
{
title = "Classic T Shirt Collection",
subtitle = "See all our colors",
image_url = "https://peterssendreceiveapp.ngrok.io/view?item=101",
buttons = new ListPostbackButton[] { new ListPostbackButton { title ="select", type = "postback", payload = "Collection" } },
});
e.Add(new ListMessengerElement
{
title = "Classic White T Shirt",
subtitle = "See all our colors",
default_action = new ListMessengerAction { type = "web_url", url= "https://peterssendreceiveapp.ngrok.io/view?item=101", messenger_extensions = false, webview_height_ratio ="tall"}
});
e.Add(new ListMessengerElement
{
title = "Classic Blue T Shirt",
subtitle = "100 Comfortable",
image_url = "https://peterssendreceiveapp.ngrok.io/view?item=101",
default_action = new ListMessengerAction { type = "web_url", url = "https://peterssendreceiveapp.ngrok.io/view?item=101", messenger_extensions = true, webview_height_ratio = "tall", fallback_url= "https://peterssendreceiveapp.ngrok.io/" },
buttons = new ListPostbackButton[] { new ListPostbackButton { title = "select", type = "postback", payload= "Blue" } },
});
List<ListPostbackButton> bs = new List<ListPostbackButton>();
bs.Add(new ListPostbackButton { type = "postback", title = "View More", payload = "View More" });
fbmsg.ChannelData.attachment.payload.elements = e.ToArray();
fbmsg.ChannelData.attachment.payload.buttons = bs.ToArray();
return fbmsg.ChannelData;
}`
`
ListTemplate.cs
public class ListMessenger
{
public ListMessengerChannelData ChannelData { get; set; }
}
public class ListMessengerChannelData
{
public string notification_type { get; set; }
public ListMessengerAttachment attachment { get; set; }
}
public class ListMessengerAttachment
{
public string type { get; set; }
public ListMessengerPayload payload { get; set; }
}
public class ListMessengerPayload
{
public string template_type { get; set; }
public ListMessengerElement[] elements { get; set; }
// for list only
public string top_element_style { get; set; }
// for list only
public ListPostbackButton[] buttons { get; set; }
}
public class ListMessengerElement
{
public string title { get; set; }
public string subtitle { get; set; }
public string item_url { get; set; }
public string image_url { get; set; }
public ListPostbackButton[] buttons { get; set; }
public ListMessengerAction default_action { get; set; }
}
public class ListUrlButton : ListMessengerAction
{
public string title { get; set; }
}
public class ListPostbackButton
{
public string type { get; set; }
public string title { get; set; }
public string payload { get; set; }
}
public class ListMessengerAction
{
public string type { get; set; }
public string url { get; set; }
public Boolean messenger_extensions { get; set; }
public string webview_height_ratio { get; set; }
public string fallback_url { get; set; }
}
}`
`
the Json generated by Bot Framework Emulator
"channelData": {
"notification_type": "NO_PUSH",
"attachment": {
"type": "template",
"payload": {
"template_type": "list",
"elements": [
{
"title": "Classic T Shirt Collection",
"subtitle": "See all our colors",
"image_url": "https://peterssendreceiveapp.ngrok.io/view?item=101",
"buttons": [
{
"type": "postback",
"title": "select",
"payload": "Collection"
}
]
},
{
"title": "Classic White T Shirt",
"subtitle": "See all our colors",
"default_action": {
"type": "web_url",
"url": "https://peterssendreceiveapp.ngrok.io/view?item=101",
"messenger_extensions": false,
"webview_height_ratio": "tall"
}
},
{
"title": "Classic Blue T Shirt",
"subtitle": "100 Comfortable",
"image_url": "https://peterssendreceiveapp.ngrok.io/view?item=101",
"buttons": [
{
"type": "postback",
"title": "select",
"payload": "Blue"
}
],
"default_action": {
"type": "web_url",
"url": "https://peterssendreceiveapp.ngrok.io/view?item=101",
"messenger_extensions": true,
"webview_height_ratio": "tall",
"fallback_url": "https://peterssendreceiveapp.ngrok.io/"
}
}
],
"top_element_style": "compact",
"buttons": [
{
"type": "postback",
"title": "View More",
"payload": "View More"
}
]
}
}
}
`
I hope you can help me find the problem and give me the solution if possible.
Add any other context about the problem here.
[bug]
[dotnet]
I have three dialog that works as explained below
I have a Receipt Dialog, but when the dialog is called it first goes to Onboarding dialog to check if the user has onboarded if the user has to onboarded it start the onboarding process, and then calls an OTP Dialog to complete the transcation. But when it gets to the OTP Dialog it does not wait for the user to enter the generated token.
Below is the code
OnBoarding Dialog
`private async Task AccountNumberEnteredAsync(IDialogContext context, IAwaitable result)
{
try
{
if (await result is IMessageActivity resp)
{
var userID = context.Activity.From.Id;
var channelID = context.Activity.ChannelId;
var customerEnquiry = DialogFactory.Create<ICustomerEnquiry>();
string phoneNum = await customerEnquiry.GetCustomerPhoneNumberAsync(resp.Text);
context.PrivateConversationData.SetValue(StringConstants.TEMP_ACCOUNT_NUMBER, resp.Text);
context.PrivateConversationData.SetValue(StringConstants.PHONE_NUMBER, phoneNum);
context.Call(DialogFactory.Create<OTPDialog>(), ResumeAfterOTPAsync);
}
}
catch (Exception ex)
{
Telemetry.TrackException(ex);
await context.PostAsync(L("FORM_ERROR"));
context.Done(false);
}
}
`
OTP Dialog
`private async Task InitiateOTP(IDialogContext context)
{
try
{
if (!context.UserData.TryGetValue(StringConstants.USER_OTP_KEY, out this.secret))
{
var username = context.UserData.GetValueOrDefault<string>(StringConstants.ACCESS_MOBILE_USERNAME);
context.Fail(new AppException(L("OTPGENERATIONERROR", new object[] { username })));
}
else
{
context.PrivateConversationData.TryGetValue(StringConstants.PHONE_NUMBER, out string phoneNum);
var otp = await TwoFactorAuth.GetOTPAsync(this.secret);
await SendTokenSMSAsync(otp, new List<string>() { phoneNum });
await context.PostAsync(L("OTP_SENT_MESSAGE") + " " + otp);
context.Wait(this.OTPEnteredAsync);
}
}
catch (TooManyAttemptsException ex)
{
Telemetry.TrackException(ex);
await context.PostAsync(L("HERO_CARD_TRIALS_EXCEEDED"));
context.Done(false);
}
catch (InvalidOperationException ex)
{
Telemetry.TrackException(ex);
await context.PostAsync(L("FORM_ERROR"));
context.Done(false);
}
finally
{
Telemetry.TrackTrace(nameof(StartAsync));
}
}`
Resumed after OTP has been entered (but it does not wait for the user to enter OTP)
`private async Task OTPEnteredAsync(IDialogContext context, IAwaitable<object> result)
{
try
{
var response = await result as Activity;
var yesy = await result;
if (response != null && !string.IsNullOrEmpty(response.Text) && response.Text.Equals(RESEND, StringComparison.InvariantCultureIgnoreCase))
{
context.PrivateConversationData.TryGetValue(StringConstants.PHONE_NUMBER, out string phoneNum);
var otp = await TwoFactorAuth.GetOTPAsync(this.secret);
await SendTokenSMSAsync(otp, new List<string>() { phoneNum });
await context.PostAsync(L("OTP_SENT_MESSAGE"));
context.Wait(OTPEnteredAsync);
}
else
{
if (response != null && !response.Text.IsNullOrEmpty())
{
var isValidated = await TwoFactorAuth.ValidateOTPAsync(this.secret, response.Text);
if (!isValidated && authTrialCount++ < int.Parse(await SettingManager.GetSettingValueAsync(BotEngineConsts.SettingNames.AuthTrialLimit)))
{
await context.PostAsync(L("OTP_INVALID"));
context.Wait(OTPEnteredAsync);
}
else
{
context.Done(isValidated);
}
}
else
{
context.Wait(OTPEnteredAsync);
}
}
}
catch (Exception ex)
{
throw;
}
context.Wait(OTPEnteredAsync);
}`
How do i make it wait for the user to enter OTP before continuing. Am Makeing use of Autofac for DI
V3.16.1.38846
I created a bot (MicrosoftAppId: b83eb276-df6d-4ce1-a326-3b69aec65bdb) and deployed it on azure.
The deploy works but I get the message: "Sorry, my bot code is having an issue" Whenever I write to the bot.
The error is: Operation returned an invalid status code MethodNotAllowed
Few things to keep in mind:
protected void Application_Start()
{
var store = new InMemoryDataStore();
Conversation.UpdateContainer(
builder =>
{
builder.Register(c => store)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder.Register(c => new CachingBotDataStore(store,
CachingBotDataStoreConsistencyPolicy
.ETagBasedConsistency))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
});
GlobalConfiguration.Configure(WebApiConfig.Register);
}
What could be causing the problem?
Thanks :)
[bug]
[dotnet]
Hello
Can we implement something like below in bot framework.
https://github.com/MicrosoftDocs/msteams-docs/blob/master/msteams-platform/concepts/authentication/auth-silent-AAD.md
Currently the user has to launch a window to authenticate. But if above works then if user is alreeady connected to some Azure AD then it can pick up auth tokent automatically. Please let me know.
Bot is totally not functional in Citrix secure web.
Where as bot is working fine Chrome mobile browser
We're are using in secure brower to secure with authentication.
Steps to reproduce the behavior:
Bot should work the way it function in desktop browser
Needed to respond in Citrix Secure web Mobile reason being user is authenticated and context of current user is set.
Link to app Citrix Secure web mobile
SDK Version: 3.13.1
No way to send HTML content to a Skype for business client. According to https://msdn.microsoft.com/en-us/skype/skype-for-business-bot-framework/docs/overview it should be possible.
The messages are always sent as plain text and not HTML.
builder.Prompts.choice(session, "What's your preferred language?", "English|Spanish|Arabic", { listStyle: builder.ListStyle.button });
The message should appear with three buttons.
The output is like this: https://www.screencast.com/t/awcds8Et1
Either no buttons or numbered list of three options.
Doesn't Skype for business support HTML content? Or is it some particular Skype for business client?
[bug]
[javascript]
[nodejs]
[node.js SDK]
[skypeforbusiness]
[botbuilder]
What package version of the SDK are you using.
3.15
Give a clear and concise description of what the bug is.
Versions of jsonwebtoken and base64url are out of date and cause "moderate" security warnings when running npm audit
Clone the repo
npm i
npm audit
You will see moderate warnings about these packages.
No warnings should be shown.
Add any other context about the problem here.
[bug]
[javascript]
From @aniketk1264 on October 18, 2018 18:9
We are using azure table storage for maintaining botstate. When user tries to login in our application and tries to initiate dialog with bot for 1st time, we only had userData in table storage at that point of time. Before initiating dialog, we are loading the botstate(userData/ConversationData/PrivateConversationData). Since we don't have conversation data/PrivateConversationData in table storage at that point of time, dependency failures for table storage with response code : 404 are getting logged in Application Insights.
Initially we were using BotBuilder V3.11 and had our own custom implementation for maintaining botstate. So we were handling it by verifying if that botdata exists in table storage and then only used to load it.
Recently we have upgraded the Bot Builder version to 3.15.3 and we are overriding the Microsoft implementation instead of having the custom implementation. With this implementation, when we try to load botstate for user when he initiates dialog with bot for 1st time, dependency failures for conversation data/private Conversation Data are getting logged in Application Insights.
Below are the requests for which 404 dependency failures are getting logged
https://sa7364dipaprd.table.core.windows.net:443/botdata(PartitionKey='webchat:conversation',RowKey=)
https://sa7364dipaprd.table.core.windows.net:443/botdata(PartitionKey='webchat:private',RowKey=conversationId:UserId)
Please find below the code change we applied for handling the 404 failures when we were using Bot Builder v3.11
async Task<BotData> IBotDataStore<BotData>.LoadAsync(IAddress key, BotStoreType botStoreType, CancellationToken cancellationToken)
{
//await WriteTraceFileLogsInfo("Entered LoadAsync in Bot.Builder.Azure");
var entityKey = BotDataEntity.GetEntityKey(key, botStoreType);
try
{
bool isExists = await EntityExists(entityKey.PartitionKey, entityKey.RowKey);
if (isExists)
{
var result = await this.Table.ExecuteAsync(TableOperation.Retrieve<BotDataEntity>(entityKey.PartitionKey, entityKey.RowKey));
BotDataEntity entity = (BotDataEntity)result.Result;
//await WriteTraceFileLogsInfo(string.Format("Data in storage for UserId : {0}", key.UserId));
if (entity == null)
// empty record ready to be saved
return new BotData(eTag: String.Empty, data: null);
//await WriteTraceFileLogsInfo("Exit LoadAsync in Bot.Builder.Azure");
// return botdata
return new BotData(entity.ETag, entity.GetData());
}
else
{
return new BotData(eTag: String.Empty, data: null);
}
}
catch (StorageException err)
{
//await WriteTraceFileLogsInfo("Error in LoadAsync in Bot.Builder.Azure :" + err);
throw new HttpException(err.RequestInformation.HttpStatusCode, err.RequestInformation.HttpStatusMessage);
}
}
/// <summary>
///
/// </summary>
/// <param name="partitionKey"></param>
/// <param name="rowKey"></param>
/// <returns></returns>
public async Task<bool> EntityExists(string partitionKey, string rowKey)
{
bool isExists = false;
TableQuery<BotDataEntity> tableQuery = new TableQuery<BotDataEntity>().Where(TableQuery.CombineFilters(
TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, partitionKey),
TableOperators.And,
TableQuery.GenerateFilterCondition("RowKey", QueryComparisons.Equal, rowKey)));
TableContinuationToken token = null;
do
{
TableQuerySegment<BotDataEntity> result = await this.Table.ExecuteQuerySegmentedAsync(tableQuery, token);
token = result.ContinuationToken;
if (result.Results.Any())
isExists = true;
}
while (token != null);
return isExists;
}
In the above code, we used to check if botdata exists in table storage using EntityExists() before retrieving it from azure table storage and we have handled 404 dependency failures
Below is the State implementation when we upgraded Bot Builder to V3.15.3 for loading botState.
public static async Task<BotData> GetBotDataAsync(string channelId, string userId)
{
BotData botData = new BotData();
using (var scope = Conversation.Container.BeginLifetimeScope())
{
IBotDataStore<BotData> botDataStore = scope.ResolveKeyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore);
var key = new AddressKey()
{
BotId = "",
ChannelId = channelId,
UserId = userId,
ConversationId = "",
ServiceUrl = ""
};
botData = await botDataStore.LoadAsync(key, BotStoreType.BotUserData, CancellationToken.None);
await botDataStore.FlushAsync(key, CancellationToken.None);
}
return botData;
}
In the above code could you please suggest how to check if botData exists in table storage before retrieving it using loadAsync() so that we can handle 404 failures related to conversationData/PrivateConversationData which are getting logged in application insights.
Since conversationData/PrivateConversationData is not maintained in storage at that point of time and only userData is maintained in it, 404 dependency failures are getting logged in application insights
We need to handle these failures before loading botstate when user initiates dialog with bot for 1st time
Copied from original issue: microsoft/botframework-sdk#5111
From @tomlm on October 2, 2018 17:50
fooofoofoo
Copied from original issue: microsoft/botframework-sdk#5090
Version 3
Direct Line
Send Hello to bot, activities are not sent back
Steps to reproduce the behavior:
On a bot with directline interface, if you send a Hi to a bot, you get no response back
Give a clear and concise description of what you expected to happen.
Bot is not answering to client
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
[bug]
[javascript]
3.17.0.42969
Microsoft.Bot.Connector.ErrorResponseException
operation returned an invalid status code 'Unauthorized'
If the application hasn't been used for an hour or more there is an authorization error at the start of a conversation with the app. If the error is ignore the conversation continues normally.
Expect the conversation to start without an error.
Error Details:
1+<FlushAsync>d__9.MoveNext","level":15,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":16,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":17,"line":0},{"assembly":"Microsoft.Bot.Builder, Version=3.17.0.42969, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Internals.DialogTaskManagerBotDataLoader+<FlushAsync>d__12.MoveNext","level":18,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":19,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":20,"line":0},{"assembly":"Microsoft.Bot.Builder, Version=3.17.0.42969, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Internals.PersistentDialogTask+<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext","level":21,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":22,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":23,"line":0},{"assembly":"Microsoft.Bot.Builder, Version=3.17.0.42969, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Internals.ExceptionTranslationDialogTask+<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__2.MoveNext","level":24,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":25,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":26,"line":0},{"assembly":"Microsoft.Bot.Builder, Version=3.17.0.42969, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Internals.SerializeByConversation+<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__4.MoveNext","level":27,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":28,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":29,"line":0},{"assembly":"Microsoft.Bot.Builder, Version=3.17.0.42969, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUser+<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__5.MoveNext","level":30,"line":0},{"assembly":"Microsoft.Bot.Builder, Version=3.17.0.42969, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Internals.PostUnhandledExceptionToUser+<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__5.MoveNext","level":31,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":32,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":33,"line":0},{"assembly":"Microsoft.Bot.Builder, Version=3.17.0.42969, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Internals.LogPostToBot+<Microsoft-Bot-Builder-Dialogs-Internals-IPostToBot-PostAsync>d__3.MoveNext","level":34,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":35,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":36,"line":0},{"assembly":"Microsoft.Bot.Builder.Autofac, Version=3.17.0.42969, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Conversation+<SendAsync>d__11.MoveNext","level":37,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":38,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":39,"line":0},{"assembly":"Microsoft.Bot.Builder.Autofac, Version=3.17.0.42969, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"Microsoft.Bot.Builder.Dialogs.Conversation+<SendAsync>d__6.MoveNext","level":40,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":41,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":42,"line":0},{"assembly":"Bot Application1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","method":"RiBot.MessagesController+<Post>d__3.MoveNext","level":43,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":44,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":45,"line":0},{"assembly":"System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"System.Threading.Tasks.TaskHelpersExtensions+<CastToObject>d__3
1.MoveNext","level":46,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":47,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":48,"line":0},{"assembly":"System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"System.Web.Http.Controllers.ApiControllerActionInvoker+d__0.MoveNext","level":49,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":50,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":51,"line":0},{"assembly":"System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"System.Web.Http.Filters.ActionFilterAttribute+d__5.MoveNext","level":52,"line":0},{"assembly":"System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"System.Web.Http.Filters.ActionFilterAttribute+d__5.MoveNext","level":53,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":54,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":55,"line":0},{"assembly":"System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"System.Web.Http.Filters.ActionFilterAttribute+d__0.MoveNext","level":56,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":57,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":58,"line":0},{"assembly":"System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"System.Web.Http.Controllers.ActionFilterResult+d__2.MoveNext","level":59,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess","level":60,"line":0},{"assembly":"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089","method":"System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification","level":61,"line":0},{"assembly":"System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35","method":"System.Web.Http.Dispatcher.HttpControllerDispatcher+d__1.MoveNext","level":62,"line":0}],"outerId":"0","message":"Operation returned an invalid status code '0'","type":"Microsoft.Bot.Connector.ErrorResponseException","id":"138365"}][bug]
[dotnet]
Is your feature request related to a problem? Please describe.
Today, we do not have any view into LUIS traffic that are driven by botbuilder. LUIS service instruments all calls to the service and can report on User-Agent to identify the specific client.
Describe the solution you'd like
On all calls to LUIS service, include User-Agent header with the following value -
botbuilder/v3-sdk/csharp/major.minor.patch.build
botbuilder/v3-sdk/js/major.minor.patch.build
[enhancement]
[dotnet]
Dotnet SDK
Javascript SDK
Clean pull of the repository.
ArgumentNullException when messaging a bot without MicrosoftAppId and MicrosoftAppPassword
Steps to reproduce the behavior:
System.ArgumentNullException: 'Value cannot be null.
Parameter name: clientId'
Stack Trace:
at Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential..ctor(String clientId, String clientSecret)
at Microsoft.Bot.Connector.MicrosoftAppCredentials..ctor(String appId, String password) in C:\work\v3\clean11.16.2018\BotBuilder-V3\CSharp\Library\Microsoft.Bot.Connector.Shared\MicrosoftAppCredentials.cs:line 65
at lambda_method(Closure , Object[] )
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
Communicating with a bot from the emulator without an appid and password in bot or emulator should work
Introduced with #53
[bug]
[dotnet]
3.15.2.0
GetConversations
returns MethodNotAllowed
Steps to reproduce the behavior:
var connector = new ConnectorClient(new Uri(context.Activity.ServiceUrl));
Conversations c = new Conversations(connector);
var conversations = c.GetConversations();
GetConversations
returns a list of conversations
[bug]
[dotnet]
Microsoft BotbuilderSDK: 3.15.0
Language: NodeJs
I am trying to initialize my dialogs with LUIS but it's not working.
I have each dialog in different subfolders. I am using bot.library and require to call the subfolders in app.js. The dialogs work when I use session.beginDialog to trigger them as in the example below.
var bot = new builder.UniversalBot(connector, function (session) {
session.beginDialog('hello:Hello')
}).set('storage', cosmosStorage);
But the conversations are not initiated when Luis is included. Each conversation has the correct LUIS calls/integrations.
Here is the full source code:
require('dotenv').config();
const restify = require('restify');
const builder = require('botbuilder');
var fs = require('fs');
var clients = require('restify-clients');
var azure = require('botbuilder-azure');
var listenPort = process.env.port || process.env.PORT || 3978;
var server = restify.createServer()
server.listen(listenPort, '::', () => {
console.log(`ssssTestt`)
});
var connector = new builder.ChatConnector({
appId: process.env.MICROSOFT_APP_ID,
appPassword: process.env.MICROSOFT_APP_PASSWORD
});
var bot = new builder.UniversalBot(connector, function (session) {
session.endDialog(`I'm sorry, I did not understand '${session.message.text}'.\nType 'help' to know more about me :)`)
}).set('storage', cosmosStorage);
var luisRL = new builder.LuisRecognizer(process.env.LUIS_MODEL_URL).onEnabled(function (context, callback) {
var enabled = context.dialogStack().length === 0
callback(null, enabled)
});
var intents = new builder.IntentDialog({ recognizers: [luisRL] });
bot.recognizer(intents);
server.post('/api/messages', connector.listen());
bot.on('conversationUpdate', function (message) {
if (message.membersAdded) {
greetings = 'welcome to Joey's Pizza?'
message.membersAdded.forEach(function (identity) {
if (identity.id === message.address.bot.id) {
bot.send(new builder.Message()
.address(message.address)
.text(greetings)
)
}
})
}
});
bot.library(require('./dialogs/reservations').createLibrary());
bot.library(require('./dialogs/order').createLibrary());
bot.library(require('./dialogs/cancellations').createLibrary());
3.16.1.xxxx has a bug introduced by the following commit
3f6da33#diff-1f91ba761477b26405ffa0278d8ace6d
This commit is being reverted, and as a result, we need to cut a new build
3.16.2.xxxx
[bug]
[dotnet]
Microsoft.Bot.Builder.FormFlow.Json
3.15.2 Not repro
3.15.2.3 Not repro
3.15.3 Repro
...
3.17.0.42969 Repro
High memory usage occurs in the sample of Annotated Sandwich Bot when using FormFlow JSON schema.
Every time I answer the question written in JSON, the memory usage increases about 100 MB. OutOfMemoryException occurred in my customer's environment.
Steps to reproduce the behavior:
Open this sample in Visual Studio 2017.
AnnotatedSandwichBot
https://github.com/Microsoft/BotBuilder-V3/tree/master/CSharp/Samples/AnnotatedSandwichBot
Click 'Start Debugging'
Talk with bot using emulator and see memory window
Compare of [email protected] and [email protected]
https://github.com/Microsoft/BotBuilder-V3/compare/[email protected]@3.15.3.0
I think this change is the cause of this issue.
4fbea59
Since OrderBy method has poor memory efficiency, I think that high memory usage is occurring as the following discussion.
How to avoid OrderBy - memory usage problems
https://stackoverflow.com/questions/3329985/how-to-avoid-orderby-memory-usage-problems
[bug]
[dotnet]
From @PrernaGupta1 on October 23, 2018 3:55
Bot Info
•SDK Platform: .NET
•SDK Version: 3.8.1.0
•Active Channels: Direct Line
•Deployment Environment: Azure App Service deployed version
Issue Description
Expected Behavior
Response time should remain similar around 500ms.
Bot should be up and running without restarting an app service
Copied from original issue: microsoft/botframework-sdk#5115
1-Goto Azure Portal
2-Select Bot App
3-Channels
4- Kik
5- Add Credentials (Display Name and Token)
6- Save
Save and Enable Kik Channel
Unable to save. Failed to register with: BadRequest ID:
Messenger and Telegram are working but Kik configuration page is throwing an error. I've tried to connect bot with kik through a different Bot Service in Azure but getting the same error.
What package version of the SDK are you using.
3.15.0
Video Card and Animation Card are not shown in Microsoft Teams channel. In emulator or other channel - no problems.
Steps to reproduce the behavior:
Normal view of Video Card, Animation card
When I got to Azure portal to MS Teams channel I see this:
We have searched across all v3 code base - there is no aspect
property or anything. It exists only from v4 in C#
[bug]
[javascript]
3.15.22
I used the Dialogue.choice to display selections.
In the Web Chat, it look like this
But in the facebook messenger it look like this
I also tried the hero card and channeldata, the facebook layout is always same.
It seems a issue in botframework, and I want to know how to display long line selection which have more than 3 selections.
[bug]
[dotnet]
SDK Platform: .NET
Microsoft.Bot.Builder 3.16.1.38846
Microsoft.Bot.Connector 3.16.1.38846
Getting 'Microsoft.Bot.Connector.ErrorResponseException: Operation returned an invalid status code 'Unauthorized' exception while calling context.PostAsync() from today. our all production bots have this issue. yesterday bots are working fine. From today only we have this issue.
When ever Interact with bot throwing exception
bot should return proper response
3.19.1.44133
The Directline channel seems to be offline. The channel closes any connection when trying to send response messages, resulting in exceptions.
Other channels such as FB Messenger and Emulator still works with the same code.
Steps to reproduce the behavior:
public async Task StartAsync(IDialogContext context)
{
var msg = context.MakeMessage();
msg.Text = "Hello";
try
{
await context.PostAsync(msg);
} catch (Exception exception)
{
throw;
}
}
Should send response message to the connection and not throw and exception.
Stack trace of the caught exception
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.RetryDelegatingHandler.<>c__DisplayClass11_0.<<SendAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.RetryDelegatingHandler.<SendAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Microsoft.Bot.Connector.Conversations.<ReplyToActivityWithHttpMessagesAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Connector.ConversationsExtensions.<ReplyToActivityAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.AlwaysSendDirect_BotToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IBotToUser-PostAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.InputHintQueue.<Microsoft-Bot-Builder-Dialogs-Internals-IMessageQueue-QueueMessageAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.AutoInputHint_BotToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IBotToUser-PostAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.MapToChannelData_BotToUser.<PostAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.LogBotToUser.<Microsoft-Bot-Builder-Dialogs-Internals-IBotToUser-PostAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Builder.Dialogs.Internals.DialogContext.<Microsoft-Bot-Builder-Dialogs-Internals-IBotToUser-PostAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at IKEA.ChatBot.Dialogs.RootDialog.<StartAsync>d__0.MoveNext() in C:\...\Dialogs\RootDialog.cs:line 21
[bug]
[dotnet]
3.16.1.38846
I'm trying to create a localised formflow that can be proactively triggered. I'm able to create the form and trigger it through an API call using the proactive dialog trigger. However, the first question is always in English, despite the locale not being English. Nonetheless, it expects an answer in the locale in play (Mandarin in this case, (zh-SG)).
If I were to not trigger it through my API, all my questions are localised based on whatever locale I send in through the bot framework emulator. I tested this by setting up a keyword check in the root dialog, and I'm able to get all my formflow questions asked in the language specified. I've attached screenshots of how this seems to play out too.
Steps to reproduce the behavior:
if (activity.Text.Equals("Trigger"))
{
var form = new FormDialog<Form1>(new Form1(), Form1.BuildForm, FormOptions.PromptInStart, null);
context.Call(form, formCompleteAsync);
}
public IHttpActionResult Post([FromBody]Model Model)
{
if (ModelState.IsValid)
{
try
{
StartProactiveDialogAsync(model.someId, model.anotherId)
return Ok();
}
catch (Exception ex)
{
return BadRequest(ex.Message);
}
}
else
{
return BadRequest(ModelState);
}
}
StartProactiveDialogAsync
public async Task StartProactiveDialogAsync(someId, anotherId )
{
try
{
// Recreate the message from the conversation reference that was saved previously.
Activity activity = JsonConvert.DeserializeObject<Activity>(BotUserData.ConversationReference);
MicrosoftAppCredentials.TrustServiceUrl(activity.ServiceUrl);
var client = new ConnectorClient(new Uri(activity.ServiceUrl));
// Create a scope that can be used to work with state from bot framework.
using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, activity))
{
var botData = scope.Resolve<IBotData>();
await botData.LoadAsync(CancellationToken.None);
// This is the dialog stack.
var stack = scope.Resolve<IDialogTask>();
// Create the new dialog and add it to the stack.
var dialog = new CallDialog(parameter1, parameter2);
stack.Call(dialog.Void<object, IMessageActivity>(), null);
await stack.PollAsync(CancellationToken.None);
// Flush the dialog stack back to its state store.
await botData.FlushAsync(CancellationToken.None);
}
}
catch (Exception e)
{
await ProprietaryDiagnosticsTool.SendDiagnostic(e);
}
}
CallDialog
public class CallDialog : IDialog<object>
{
Parameter1 param1;
Parameter2 param2;
public CallDialog(Parameter1 param1, Parameter2 param2)
{
this.param1 = param1;
this.param2 = param2;
}
public async Task StartAsync(IDialogContext context)
{
switch (param1.Id)
{
case 1:
{
var form = new FormDialog<Form1>(new Form1(), Form1.BuildForm, FormOptions.PromptInStart, null);
context.Call(form, formComplete);
break;
}
case 2:
{
var form = new FormDialog<Form2>(new Form2(), Form2.BuildForm, FormOptions.PromptInStart, null);
context.Call(form, formComplete);
break;
}
case 3:
{
var form = new FormDialog<Form3>(new Form3(), Form3.BuildForm, FormOptions.PromptInStart, null);
context.Call(form, formComplete);
break;
}
}
}
private async Task formComplete(IDialogContext context, IAwaitable<FormParent> result)
{
var ans = await result;
await context.PostAsync("Result received");
context.Done(this);
}
}
When calling the proactive dialog which calls the form in a different locale, the form should be presented in the locale specified
English formflow triggered through keyword - correct
English formflow triggered through API - correct
Mandarin formflow triggered through keyword - correct
Mandarin formflow triggered through API - incorrect
The error message says
"Yes" is not an option for question 1.
I've traced the context.activity object through the various methods, from StartProactiveDialogAsync to CallDialog all the way till the formComplete method. The locale does tend to be correct, its simply the display of the first question of the proactive dialog calling the formflow that happens to be in the wrong language.
[bug]
3.15.3
Web Chat
deployed to Canada Central resource
response is very slow
In webchat we got below error
Failed to load resource: the server responded with a status of 502 (Bad Gateway)
https://directline.botframework.com/v3/directline/conversations/JZkwqPEo6Ev703cWNzLdeB/activities
we created simple hello asp.net application
it is take 5-7 sec to post back to webchat event from test environment
Give a clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
similar to issue microsoft/botframework-sdk#4559
[bug]
[dotnet]
We have the Generator files still listed here, though the actual code now lives in botbuilder-samples.
Have the generator code in one repo
[bug]
[javascript]
Not sure if this is a known issue since the v3 issues disappeared when the repo was moved...
latest v3 (reproduced it in 3.15.3 and 3.16.1) and latest v4 (reproduced in 4.0.7)
Our bots fail to respond to the first message every morning. What we see in AppInsights is that the botframework token endpoint is successfully called, but the call to the conversations endpoint (triggered by context.PostAsync) fails with 401 Unauthorized.
After some investigation we think we have found a bug in the MicrosoftAppCredentials class.
The bot has to be talked to at least twice. First to get an initial token and 10 minutes later to kick off an auto refresh task. Then it needs to be completely idle for 60 more minutes so the cached token and the token retrieved by the auto refresh task have expired.
In that scenario the code in MicrosoftAppCredentials.GetTokenAsync (line 197) assumes that the last cached task will return a valid token (since it completed but with a different token than the cached one) and it will use that expired token in the request (ProcessHttpRequestAsync).
Easiest way to reproduce is with a simple ConsoleApp (with the Microsoft.Bot.Builder nuget) calling MicrosoftAppCredentials.GetTokenAsync and verifying the token expiration locally.
class Program
{
private const string AppId = "valid app id";
private const string AppSecret = "valid app secret";
private static readonly MicrosoftAppCredentials Credentials = new MicrosoftAppCredentials(AppId, AppSecret);
static void Main()
{
GetAndVerifyToken();
while (true)
{
if (Console.ReadLine() == "q")
break;
GetAndVerifyToken();
}
}
private static async Task GetAndVerifyToken()
{
var tokenString = await Credentials.GetTokenAsync().ConfigureAwait(false);
var token = new System.IdentityModel.Tokens.Jwt.JwtSecurityToken(tokenString);
Console.WriteLine($"[{DateTime.Now}] {(DateTime.UtcNow > token.ValidTo ? "ERROR: Token expired at: " : "Token valid until: ")} {token.ValidTo.ToLocalTime()}");
}
}
It is also possible to reproduce this issue with sending real messages via ConnectorClient.Conversations.SendToConversationWithHttpMessagesAsync, but that requires a bit more setup (activity with valid channel and conversation accounts, etc)
private static async Task SendMessage()
{
var message = CreateMessage();
MicrosoftAppCredentials.TrustServiceUrl(message.ServiceUrl);
var client = new ConnectorClient(new Uri(message.ServiceUrl), Credentials);
var response = await client.Conversations.SendToConversationWithHttpMessagesAsync(message.Conversation.Id, message).ConfigureAwait(false);
}
MicrosoftAppCredentials.GetTokenAsync should not return expired tokens.
A simple fix would be to check TokenExpired(oAuthTokenTask.Result.access_token) instead of comparing to the cached token in line 197.
I guess for a lot of bots out there this issue does not surface because most will try to send a "Typing" activity to the user before sending the actual message and no one really notices a missing "typing.."
We have a distributed bot network where a central bot delegates intents to other completely independent bots (running in separate web apps). The central bot sends the typing, but the actual response to the user is sent by one of the "sub bots".
[bug]
[dotnet]
Clean pull of the respository
Tests in Node\core\tests\localization.js are failing
Steps to reproduce the behavior:
Tests all pass
55 passing (2m)
23 failing
localization
should return localized prompt when found:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should return random prompt for arrays:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should return prompt in users preferred local:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should return prompt in bots default local:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should return prompt in sub-local:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should fallback to bots locale:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should fallback to bots locale for invalid preferredLocale:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should fallback to "en" for missing bot locale:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
library should return libraries prompt:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
library should return bots overriden prompt:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
library should return bots prompt for missing locale:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should use bots namespace for prompt:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should use bots namespace for retryPrompt:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should use libraries namespace for prompt:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should use libraries namespace for retryPrompt:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should use bots namespace for cancelAction:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should use bots namespace for reloadAction:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
localization
should use bots namespace for endConversationAction:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\localization.js)
promptRecognizers
should recognize a localized RegExp:
Uncaught AssertionError [ERR_ASSERTION]: false == true
-false
+true
at botbuilder (tests\promptRecognizers.js:13:17)
at next (lib\Session.js:86:17)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\Session.js:110:17
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\DefaultLocalizer.js:64:17
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\async\lib\async.js:52:16
at done (node_modules\async\lib\async.js:246:17)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\async\lib\async.js:44:16
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\DefaultLocalizer.js:61:64
at tryCallOne (node_modules\promise\lib\core.js:37:12)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\promise\lib\core.js:123:15
at flush (node_modules\asap\raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
promptRecognizers
should recognize localized choices:
Uncaught AssertionError [ERR_ASSERTION]: false == true
-false
+true
at botbuilder (tests\promptRecognizers.js:42:17)
at next (lib\Session.js:86:17)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\Session.js:110:17
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\DefaultLocalizer.js:64:17
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\async\lib\async.js:52:16
at done (node_modules\async\lib\async.js:246:17)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\async\lib\async.js:44:16
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\DefaultLocalizer.js:61:64
at tryCallOne (node_modules\promise\lib\core.js:37:12)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\promise\lib\core.js:123:15
at flush (node_modules\asap\raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
promptRecognizers
should recognize a localized choice using a synonym:
Uncaught AssertionError [ERR_ASSERTION]: false == true
-false
+true
at botbuilder (tests\promptRecognizers.js:59:17)
at next (lib\Session.js:86:17)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\Session.js:110:17
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\DefaultLocalizer.js:64:17
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\async\lib\async.js:52:16
at done (node_modules\async\lib\async.js:246:17)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\async\lib\async.js:44:16
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\DefaultLocalizer.js:61:64
at tryCallOne (node_modules\promise\lib\core.js:37:12)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\promise\lib\core.js:123:15
at flush (node_modules\asap\raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
promptRecognizers
should recognize a localized choice without any synonyms:
Uncaught AssertionError [ERR_ASSERTION]: false == true
-false
+true
at botbuilder (tests\promptRecognizers.js:75:17)
at next (lib\Session.js:86:17)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\Session.js:110:17
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\DefaultLocalizer.js:64:17
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\async\lib\async.js:52:16
at done (node_modules\async\lib\async.js:246:17)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\async\lib\async.js:44:16
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\lib\DefaultLocalizer.js:61:64
at tryCallOne (node_modules\promise\lib\core.js:37:12)
at C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\node_modules\promise\lib\core.js:123:15
at flush (node_modules\asap\raw.js:50:29)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
recognizers
should match a LocalizedRegExpRecognizer:
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (C:\work\v3\clean10.30.2018\BotBuilder-V3\Node\core\tests\recognizers.js)
[bug]
[javascript]
Ref:
microsoft/botbuilder-js#183
Javascript SDK
From @huajunzhao on September 13, 2018 2:53
We're trying to add the below code in Chat.tsx to resume the conversation history in webchat.
const botConnection = new BotChat.DirectLine({
secret: 'XXXXXXXXXXXXXXXXXXXXXX',
conversationId: localStorage.conversationId,
watermark: "01",
webSocket: false,
pollingInterval: 5000
});
BotChat.App({
botConnection: botConnection
,user: { id: 'USER_ID', name: 'User' },
resize: 'detect'
}, document.getElementById("chatdiv"));
botConnection.connectionStatus$.subscribe(function (status) {
if (status == 2) { // wait for connection is 'OnLine' to send data to bot
var convId = botConnection.conversationId;
if (convId !== localStorage.conversationId) {
localStorage.setItem('conversationId', convId);
}
}
});
Be able to get the conversation after botconnection is created. Any suggestions?
Getting the build error Property 'conversationId' does not exist on type 'IBotConnection'
Copied from original issue: microsoft/botframework-sdk#5055
This work was done in the v3 C# SDK as part of #52
I noticed the root readme refers to v4 being in preview, whereas v4 is now available for production bots, so should that be removed? Just in case someone stumbles across this v3 SDK and documentation.
Readme - https://github.com/Microsoft/botbuilder-v3#get-started-with-bot-builder-v4-preview
.Net BotBuilder 3.12.24
No
I am wondering whether I can save some data into BotDataStorage before user send the initial message to bot.
what I have done and know:
Enable the default BlobTable implementation to manage state data.
Bot send proactive message to user and save some user-specific data by using StateClient.
At this point, I know the bot framework actually did not save anything to BlobTable, I checked the
BlobTable there was no ConversationId I create at proactive message.
However I still can retrieve the data then I think at this point still using the memory to cache the
BotData, I also knew in conversation object there has a ExpireIn property, I can imaging the data will
be lost if user did not reply within certain amount of time. Also I want to know if I save as UserData
whether it will be expired also.
If user reply the message, then the BotData will be shown in the BlobTable.
So I want to know why the first proactive message will not persistent the data into BlobTable.
Thanks
3.16.1.38846
GetConversationsAsync
returns MethodNotAllowed
try
{
var connector = new ConnectorClient(new Uri(activity.ServiceUrl));
var conversationsResponse = await connector.Conversations.GetConversationsAsync();
await context.PostAsync(conversationsResponse.Conversations.Count.ToString());
}
catch (Exception ex)
{
await context.PostAsync(ex.Message);
}
GetConversationsAsync
returns a list of conversations
[bug]
[dotnet]
From @PrernaGupta1 on October 23, 2018 3:55
Bot Info
•SDK Platform: .NET
•SDK Version: 3.8.1.0
•Active Channels: Direct Line
•Deployment Environment: Azure App Service deployed version
Issue Description
Expected Behavior
Response time should remain similar around 500ms.
Bot should be up and running without restarting an app service
Copied from original issue: microsoft/botframework-sdk#5115
I am getting below error in my Bot very frequently, There was an error sending this message to your bot: HTTP status code GatewayTimeout.
Mainly I see this issue with Direct Line (WebChat) it works fine for other channels.
Bot Framework Version: 3.16.1.38846
My Bot is deployed in Staging environment, we are planning to move the Bot to Production very soon, but this issue seems to be blocker as it counts under performance issue.
I am using Azure Cosmos DB as state storage.
Numerous packages are being reported by GitHub as needing update.
https://github.com/Microsoft/BotBuilder-v3/network/alerts
Botbuilder: 3.15.0,
Node.js: 8.9.0
Running on my local machine
The call for builder.UniversalBot.loadSession
fails silently while called in the builder.UniversalBot.on
handler.
Steps to reproduce the behavior:
botConnection
.postActivity({
from: user,
type: 'event',
text: 'connect'
})
.subscribe(
id => console.log('Posted activity, assigned ID ', id),
error => console.log('Error posting activity', error)
);
bot.on('event', data => {
bot.loadSession(data.address, (error, session) => {
if (error) {
console.error(error);
}
...
});
});
bot.on('event', data => {
const promisifyLoadSession = promisify(bot.loadSession);
promisifyLoadSession(data.address)
.then(_ => {
console.log(_);
})
.catch(err => {
console.error(err);
});
});
I get the following catched error message and stack trace:
{
message: "Cannot read property 'loadSessionWithOptionalDispatch' of undefined",
stack: "TypeError: Cannot read property 'loadSessionWithOptionalDispatch' of undefined
at UniversalBot.loadSession (/home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:253:14)
at internal/util.js:227:26
at UniversalBot.bot.on.data (/home/fbulic/Bots/Bot-HandOff/app.ts:75:5)
at emitOne (events.js:116:13)
at UniversalBot.emit (events.js:211:7)
at /home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:156:31
at /home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:427:53
at UniversalBot.tryCatch (/home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:516:13)
at next (/home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:427:23)
at UniversalBot.eventMiddleware (/home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:430:9)
at /home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:141:23
at /home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:472:53
at UniversalBot.tryCatch (/home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:516:13)
at /home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:472:23
at UniversalBot.tryCatch (/home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:516:13)
at UniversalBot.lookupUser (/home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:459:14)
at /home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:136:19
at /home/fbulic/Bots/Bot-HandOff/node_modules/async/lib/async.js:181:20
at replenish (/home/fbulic/Bots/Bot-HandOff/node_modules/async/lib/async.js:319:21)
at /home/fbulic/Bots/Bot-HandOff/node_modules/async/lib/async.js:330:15
at Object.async.forEachLimit.async.eachLimit (/home/fbulic/Bots/Bot-HandOff/node_modules/async/lib/async.js:220:35)
at UniversalBot.receive (/home/fbulic/Bots/Bot-HandOff/node_modules/botbuilder/lib/bots/UniversalBot.js:133:15)"
}
Should loadSession without failing silently.
[bug]
[javascript]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.