[Facebook Messenger] Issue with PromptDialog.Choice and Facebook
I have my Facebook bot online and I am inspecting all the requests in my server. Sometimes my server is not receiving messages. If I retry and send a message many times, it works. If I use the emulator it works fine.
Example image I wrote three times "pollo" to get the answer.
Any idea?
hi @yamifr07 - can you provide more details about your issue?
Pre-flight checklist
- [ ] I have reviewed the BotBuilder SDK Contribution Guidelines
- [ ] I posted a question about this issue on Stack Overflow using the tag
#botframework. - [ ] I have asked for help in the Bot Framework Gitter group before filing this issue.
- [ ] I have searched the existing issues before logging a new one.
Environment
- Operating System:
- Windows
- macOS
- Linux
- SDK Platform:
- C#/.NET
- Node.js
- SDK version:
- Development environment:
- localhost
- Azure Web App
- Azure Bot Service App
- other
- If you are using the Node.js SDK:
- Node.js version:
- NPM version:
Issue
What the issue is, in broad strokes. Link to Stack Overflow post.
Example Code
The code snippet or complete bot example (preferred) that demonstrates the issue.
Steps to Reproduce
Please provide the shortest amount of steps to reproduce your issue.
Expected Behavior
What you expected to happen.
Actual Results
What actually happened. Please give examples and support it with screenshots, copied output or error messages.
@Pre-flight checklist
I have reviewed the BotBuilder SDK Contribution Guidelines x I posted a question about this issue on Stack Overflow using the tag #botframework. I have asked for help in the Bot Framework Gitter group before filing this issue. x I have searched the existing issues before logging a new one.
Environment
Operating System: Windows macOS x Linux
SDK Platform: C#/.NET x Node.js
SDK version: Development environment: x localhost Azure Web App Azure Bot Service App other
If you are using the Node.js SDK: Node.js version: v6.6.0 NPM version: 3.10.3
Issue
What the issue is, in broad strokes. Link to Stack Overflow post. StackOverflow I log everything in my server using morgan and I don't see messages when bot does not reply. The log when it works is: POST /api/messages 202 - [10/Apr/2017:20:03:30 +0000] - - - 1.624
Steps to Reproduce Answer multiple Prompts choices quickly (reply as soon as you receive the options). Chat displays the answer but is not being received in the server.
Expected Behavior
What you expected to happen. Receive user messages
Actual Results
What actually happened. Please give examples and support it with screenshots, copied output or error messages. Must send the message many times to receive it. Image
I also tried the example code I found in this repository. Same problem... So you can run Microsoft example in Facebook messanger and some message are being ignore. Sometimes it replays ok and sometime doesn't.
So... Any updates. If it doesn't work on Facebook I must use another framework :(
I think this is the same issue I am currently having. Did you check for errors on your botframework login? The errors I am seeing are from the BotFramework showing unauthorized and then authorized and then unauthorized. StackOverflow Here Now it appears to be working but any custom facebook channel data is still experiencing this problem. As a side note, I noticed Facebook released a new version of it's API on April 18th... Coincidence?
Hi @yamifr07 We have just released many updates to the Bot Framework including a complete re-write of the prompts system available in botbuilder v3.8.x NPM module.
Are you still experiencing the issue after upgrading botbuilder to v3.8.x? To upgrade use npm upgrade --save botbuilder.
If you are still having issues after upgrading the botbuilder module, can you post your complete bot code? This will help us debug the issue.
Yes, still having issue. I think it's easy to reproduce but here is my code:
bot.dialog('/menu', [
(session) => {
builder.Prompts.choice(session, 'Bots disponibles:', 'Horoscope|News', {listStyle: builder.ListStyle.button});
},
(session, results) => {
let dialog;
switch(results.response.index) {
case 0:
dialog = 'horoscope';
break;
case 1:
dialog = 'news';
break;
}
session.beginDialog('/' + dialog);
},
(session, results) => {
session.replaceDialog('/menu');
}
])
.reloadAction('reloadMenu', null, { matches: /^menu/i });
Steps:
- Open my bot in Facebook messenger
- Go to menu and receive 2 options
- Immediately select an option. E.g.: Horoscope
- Bot does not reply (sometimes it does, so try to use prompts many times)
- Send option message many times and get expected answer.
P.S.: Microsoft server sometimes fails: Error: Request to 'https://state.botframework.com/v3/botstate/facebook/conversations/xxxxxxx-xxxxxxx/users/xxxxxxx' failed: [400] Bad Request
Hi @yamifr07 ! Have you tried replaceDialog instead of beginDialog to see a change in behaviour?
@chitrang89 yes, same issue.
Error: Request to 'https://state.botframework.com/v3/botstate/facebook/conversations/xxxxxxx-xxxxxxx/users/xxxxxxx' failed: [400] Bad Request
I have this error also if I call:
builder.Prompts.choice(session, ' ', 'Button1|Button2', {listStyle: builder.ListStyle.button});
with empty or white space message. Is it possible just to show button without preceding message? Emulator and Web Channel allows white space message, fails with empty message however.
please open a new issue if anyone is still facing this problem