From cc5b432c4c033b6be7e6c20a4dcfc4dcc242b2f5 Mon Sep 17 00:00:00 2001 From: CK Kashyap Date: Fri, 5 Oct 2018 13:50:02 -0700 Subject: [PATCH 1/3] Watermark must be forwarded to the server even in the case of websocket since the server now honors it. --- src/directLine.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/directLine.ts b/src/directLine.ts index b4ed3548d..c7ccfae94 100644 --- a/src/directLine.ts +++ b/src/directLine.ts @@ -322,10 +322,7 @@ export class DirectLine implements IBotConnection { this.conversationId = options.conversationId; } if (options.watermark) { - if (this.webSocket) - console.warn("Watermark was ignored: it is not supported using websockets at the moment"); - else - this.watermark = options.watermark; + this.watermark = options.watermark; } if (options.streamUrl) { if (options.token && options.conversationId) From 1f94896060611eb125438c5bac2ac08af9485f19 Mon Sep 17 00:00:00 2001 From: William Wong Date: Fri, 12 Oct 2018 20:36:38 -0700 Subject: [PATCH 2/3] Coding style update --- src/directLine.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/directLine.ts b/src/directLine.ts index c7ccfae94..dae54d900 100644 --- a/src/directLine.ts +++ b/src/directLine.ts @@ -316,22 +316,29 @@ export class DirectLine implements IBotConnection { this.token = options.secret || options.token; this.webSocket = (options.webSocket === undefined ? true : options.webSocket) && typeof WebSocket !== 'undefined' && WebSocket !== undefined; - if (options.domain) + if (options.domain) { this.domain = options.domain; + } + if (options.conversationId) { this.conversationId = options.conversationId; } + if (options.watermark) { this.watermark = options.watermark; } + if (options.streamUrl) { - if (options.token && options.conversationId) + if (options.token && options.conversationId) { this.streamUrl = options.streamUrl; - else - console.warn("streamUrl was ignored: you need to provide a token and a conversationid"); + } else { + console.warn('streamUrl was ignored: you need to provide a token and a conversationid'); + } } - if (options.pollingInterval !== undefined) + + if (options.pollingInterval !== undefined) { this.pollingInterval = options.pollingInterval; + } this.activity$ = (this.webSocket ? this.webSocketActivity$() From 7573db11e58a7f68da5cbd88f2aab8c5269cc233 Mon Sep 17 00:00:00 2001 From: William Wong Date: Fri, 12 Oct 2018 20:54:16 -0700 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cb17f176..74189e0f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Add support for watermark in Web Socket, in [#96](https://github.com/Microsoft/BotFramework-DirectLineJS/pull/96) ## [0.9.17] - 2018-08-31 ### Changed