Skip to content

How can I guarantee message delivery when using IDialogContext.PostAsync? #1067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eydelrivero opened this issue Aug 24, 2016 · 4 comments
Closed
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior.

Comments

@eydelrivero
Copy link

eydelrivero commented Aug 24, 2016

I'm sending two messages through the Facebook channel using this code:

              `try
                {
                    Task task = context.PostAsync(dummyActivity);
                    await task;
                    await context.PostAsync("Message terminated normally");
                }
                catch (Exception e)
                {
                    await context.PostAsync(e.Message);
                }`

The task is just to see what's going on with PostAsync. The first message is not delivered but the second one arrives without problems. Then when I check the Developer portal I see these errors:

8/24/2016, 11:08:27 AM Facebook graph API call failed with: BadRequest {"error":{"message":"(#105) param [elements] has too many elements.","type":"OAuthException","code":105,"fbtrace_id":"Ci6t+CNISwX"}}
8/24/2016, 11:08:17 AM POST to MyBot failed: A task was canceled.
8/24/2016, 11:08:17 AM Facebook graph API call failed with: BadRequest {"error":{"message":"(#105) param [elements] has too many elements.","type":"OAuthException","code":105,"fbtrace_id":"GvTURHxYEBM"}}
8/24/2016, 11:08:16 AM There was an error sending this message to your bot.
8/24/2016, 11:08:06 AM Facebook graph API call failed with: BadRequest {"error":{"message":"(#105) param [elements] has too many elements.","type":"OAuthException","code":105,"fbtrace_id":"GNb/PRAS6Fz"}}
8/24/2016, 11:08:05 AM Facebook graph API call failed with: BadRequest {"error":{"message":"(#105) param [elements] has too many elements.","type":"OAuthException","code":105,"fbtrace_id":"EWcQJDuOq9t"}}

which seems to indicate I'm sending to many cards within the same attachment in dummyActivity. Is there a way to know that the message failed when doing await context.PostAsync(dummyActivity);?

@willportnoy
Copy link
Member

That seems like a bug - the task should not be marked as completed until the message has been handed off to Facebook.

@willportnoy willportnoy added bug Indicates an unexpected problem or an unintended behavior. facebook labels Aug 24, 2016
@chrimc62
Copy link
Contributor

@willportnoy can you please investigate or close as appropriate?

@willportnoy
Copy link
Member

@chrimc62 it's been labeled as a possible bug in the Facebook channel already and added to our internal backlog for investigation.

@msft-shahins msft-shahins assigned craigjensen and unassigned tomlm Feb 2, 2017
@msft-shahins
Copy link
Contributor

This should be fixed now. Feel free to open a new issue if you are still seeing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior.
Projects
None yet
Development

No branches or pull requests

6 participants