Skip to content

Commit

Permalink
Remove replyToId for Direct Line Speech adapter (#3776)
Browse files Browse the repository at this point in the history
* Remove replyToId for Direct Line Speech adapter

* Update entry
  • Loading branch information
compulim authored Mar 4, 2021
1 parent 37fea49 commit e0b9ad6
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
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

0 comments on commit e0b9ad6

Please sign in to comment.