Skip to content
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

Remove replyToId for Direct Line Speech adapter #3776

Merged
merged 2 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Fixes [#3773](https://github.com/microsoft/BotFramework-WebChat/issues/3773). Remove `replyToId` when using Direct Line Speech adapter, by [@compulim](https://github.com/compulim) in PR [#3776](https://github.com/microsoft/BotFramework-WebChat/pull/3776)

### Samples

- Fixes [#3632](https://github.com/microsoft/BotFramework-WebChat/issues/3632). Update reaction button sample : Add replyToId to the postActivity object, by [@amal-khalaf](https://github.com/amal-khalaf) in PR [#3769](https://github.com/microsoft/BotFramework-WebChat/pull/3769)
Expand Down
40 changes: 40 additions & 0 deletions __tests__/html/chatAdapter.directLineSpeech.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<script crossorigin="anonymous" src="/__dist__/testharness.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
</head>
<body>
<div id="webchat"></div>
<script type="text/babel" data-presets="env,stage-3,react">
const { conditions, createStore, expect, host, pageObjects, timeouts, token } = window.WebChatTest;

(async function () {
window.WebChat.renderWebChat(
{
...(await window.WebChat.createDirectLineSpeechAdapters({
fetchCredentials: await token.fetchDirectLineSpeechCredentials()
})),
store: createStore()
},
document.getElementById('webchat')
);

await pageObjects.wait(conditions.uiConnected(), timeouts.directLine);

await pageObjects.sendMessageViaSendBox('Hello, World!', { waitForSend: true });
await pageObjects.wait(conditions.minNumActivitiesShown(2), timeouts.directLine);

// The next message should arrive quickly as the connection has already established.
await pageObjects.sendMessageViaSendBox('Aloha!', { waitForSend: true });
await pageObjects.wait(conditions.minNumActivitiesShown(4), 2000);

await host.done();
})().catch(async err => {
console.error(err);

await host.error(err);
});
</script>
</body>
</html>
7 changes: 7 additions & 0 deletions __tests__/html/chatAdapter.directLineSpeech.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @jest-environment ./__tests__/html/__jest__/WebChatEnvironment.js
*/

describe('Direct Line Speech chat adapter', () => {
test('should connect to the MockBot.', () => runHTMLTest('chatAdapter.directLineSpeech.html'));
});
6 changes: 0 additions & 6 deletions docs/DIRECT_LINE_SPEECH.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,6 @@ You can only specify speech recognition language at initialization time. You can

[Proactive message](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-proactive-message?view=azure-bot-service-4.0&tabs=csharp) is not supported when using Direct Line Speech.

### Emulator is not supported

> Please vote on [this bug](https://github.com/microsoft/BotFramework-WebChat/issues/2683) if this behavior is not desirable.

Currently, Emulator only support Direct Line protocol. We are planning to add Direct Line Speech protocol to Emulator.

### Abort recognition is not supported

> Please vote on [this bug](https://github.com/microsoft/BotFramework-WebChat/issues/2664) if this behavior is not desirable.
Expand Down
2 changes: 2 additions & 0 deletions packages/directlinespeech/src/DirectLineSpeech.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export default class DirectLineSpeech {
// Since DLSpeech service never ACK our outgoing activity, this activity must be from bot.
role: 'bot'
},
// Since DLSpeech never ACK our outgoing activity, the "replyToId" will rarely able to point to an existing activity.
replyToId: undefined,
// Direct Line Speech server currently do not timestamp outgoing activities.
// Thus, it will be easier to just re-timestamp every incoming/outgoing activities using local time.
timestamp: new Date().toISOString()
Expand Down