microsoft / microsoft/BotFramework-DirectLineJS
Attachments with incorrect base64 contentUrl in sendActivity fails silently
@ckkashyap đang làm issue này rồi.
Từ ngày 6/2/2019.
- Ngôn ngữ chính
- TypeScript
- Star
- 199
- Fork
- 133
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Versions
What package version of the SDK are you using: 4.0.8 (botbuilder, botbuilder-dialogs)
What nodejs version are you using: v.8.12.0
What browser version are you using: Chrome v69
What os are you using: Windows 10
Describe the bug
When trying to create an attachment that is intentionally corrupt (via an incorrect base64 url), the bot fails silently without throwing an error.
To Reproduce
- Create bot with command to trigger send activity with an attachment with the following code:
try {
console.log('Start');
await context.sendActivity({
type: 'message',
attachments: [{
contentType: 'text/plain',
contentUrl: 'data:image/png;base64,abc\nabc',
name: 'dot.png'
}]
});
console.log('Succeeded');
} catch (err) {
console.log(err);
throw err;
}
And on the BotFrameworkAdapter instance, register an onTurnError handler like so:
adapter.onTurnError = async (context, error) => {
console.log(error);
await context.sendActivity(`Sorry, ran into an error!\n ${ error.message }`);
}
- Run bot, send command utterance to send activity
- Sending the command failed
Note that there is no error in the console, and the lineconsole.log("Succeeded");is never reached. Similarly, onTurnError is never triggered.
The message fails silently, and after timing out, the Web Chat instance logs a 502 Bad Gateway error.
Sending other messages pass through successfully.
Expected behavior
Since the contentUrl is invalid, the bot should try and catch an error when this command is initiated.
[bug]
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.