microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.5k stars 2.44k forks source link

facebook messenger issue with choice prompt #2150

Closed itoledo closed 7 years ago

itoledo commented 7 years ago

Hi:

When building a disambiguation dialog with FormBuilder, using validation, Facebook Messenger responds with this: SendActivityToUserAsync FAILED: {"error":{"message":"(#100) Param [elements][0][title] must be a non-empty UTF-8 encoded string","type":"OAuthException","code":100,"fbtrace_id":"CXMxzdjgkf3"}} It's the same dialog/code as bug 1900. I updated the NuGet package to 3.5.1 to fix the issue in 1900, and now Facebook Messenger is broken. This started happening after 3.4.0 (using .NET). In 3.3.3 is working fine.

Any hints?

Thanks Ivan

willportnoy commented 7 years ago

@msft-shahins is this related to quick reply keyboard card mapping? has that changed across those versions?

msft-shahins commented 7 years ago

@willportnoy this shouldn't be related to the quick reply keyboard card. @chrimc62 can you comment?

vovanb commented 7 years ago

@willportnoy @chrimc62 Same issue with reply to Facebook in BotBuilder 3.5.2.0: "SendActivityToUserAsync FAILED: {\"error\":{\"message\":\"(#100) Param [elements][0][title] must be a non-empty UTF-8 encoded string\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"BltwwnsCdZw\"}}" Attached sample json sample.json.txt

msft-shahins commented 7 years ago

@vovanb can you share the activity that your bot is sending to facebook channel that causes this error?

vovanb commented 7 years ago

Actually I am using Microsoft.Bot.Sample.AnnotatedSandwichBot as example. So in reply to incoming activity in controller: public async Task<HttpResponseMessage> Post([FromBody] Activity activity) { if (activity.Type == ActivityTypes.Message) { await Conversation.SendAsync(activity, () => MakeJsonRootDialog());

Then: internal static IDialog<JObject> MakeJsonRootDialog() { return Chain.From(() => FormDialog.FromForm(BuildJsonForm)) .Do(async (context, order) => { var completed = await order; // Actually process the sandwich order... await context.PostAsync("Routing to queue ...");

And ` public static IForm BuildJsonForm() {

        using (Stream stream = File.OpenRead(@m_jsonFormPath))
        {
            var schema = JObject.Parse(new StreamReader(stream).ReadToEnd());
            return new FormBuilderJson(schema)
                .AddRemainingFields()
                .Build();
        }
    }`

Sample of JSON Activity I added in previous comment

vovanb commented 7 years ago

@msft-shahins can you please check my reply

msft-shahins commented 7 years ago

@vovanb what is the Microsoft app id for this bot?

vovanb commented 7 years ago

@msft-shahins you can use:

deffbcae-24cf-4f54-8da1-7fdb6e1f14ba

Fully reproduced with default sample code from: https://github.com/Microsoft/BotBuilder/tree/master/CSharp/Samples/AnnotatedSandwichBot

{"SendActivityToUserAsync FAILED: {\"error\":{\"message\":\"(#100) Param [elements][0][title] must be a non-empty UTF-8 encoded string\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"G+kR\/qRCJeK\"}}"}

On Mon, Feb 13, 2017 at 9:01 PM, Shahin Shayandeh notifications@github.com wrote:

@vovanb https://github.com/vovanb what is the Microsoft app id for this bot?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/2150#issuecomment-279488169, or mute the thread https://github.com/notifications/unsubscribe-auth/AGc0Zat34dYW8d09AWH7VnhOTG6NhDtAks5rcKihgaJpZM4LzDZM .

-- Sincerely, Vladimir

vovanb commented 7 years ago

@willportnoy @chrimc62 @msft-shahins @craigjensen
guys any feedback? To my undersatnding it is bug in Facebook connector, which affect all customers using choice prompt. So all existing bots broken....

msft-shahins commented 7 years ago

@vovanb we have a fix for the facebook channel addressing this issue. It is being verified and tested now. We should have a deployment to production in the coming days.

vovanb commented 7 years ago

@msft-shahins Wow good news, please update when it will be ready?

mrrenaud commented 7 years ago

@msft-shahins, do you have any news on this?

vovanb commented 7 years ago

@willportnoy @msft-shahins @craigjensen We are really stacked - it is not possible to use Facebook channel with MS-Bot... Can you please update when issue will be in production?

craigjensen commented 7 years ago

The fix has been deployed. Please let us know if you're still seeing the issue

vovanb commented 7 years ago

@craigjensen - you are the best, working as charm. Please keep it stable. BTW - do you plan to support all Facebook UI fetaures or exist workaround to somehow to pass them to FB?

craigjensen commented 7 years ago

We'll do our best to support as many features as possible. Is there a specific feature you are interested in?

vovanb commented 7 years ago

see below :

2250 and #2234

stevengum commented 7 years ago

A working fix has been deployed, closing issue.