Skip to content

Rework connect saga to support connectivity status and reconnection#1649

Merged
compulim merged 16 commits intomicrosoft:masterfrom
compulim:feat-rework-connect-saga
Jan 30, 2019
Merged

Rework connect saga to support connectivity status and reconnection#1649
compulim merged 16 commits intomicrosoft:masterfrom
compulim:feat-rework-connect-saga

Conversation

@compulim
Copy link
Copy Markdown
Contributor

@compulim compulim commented Jan 27, 2019

This PR is pre-requisite of #1521 and related PRs.

Today, we do not support failed to connect initially and interrupted connection. Both features are also not supported in DLJS currently. In addition, we also do not support abort before a connection is made.

This PR will enable those scenarios. And we will work on support from DLJS side.

Changelog

Changed

  • core: Reworked logic on connect/disconnect for reliability on handling corner cases, by @compulim in PR #1649

@coveralls
Copy link
Copy Markdown

coveralls commented Jan 27, 2019

Pull Request Test Coverage Report for Build 888

  • 34 of 61 (55.74%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 52.542%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/core/src/sagas/connectSaga.js 31 58 53.45%
Files with Coverage Reduction New Missed Lines %
packages/core/src/sagas/effects/whileConnected.js 1 83.33%
Totals Coverage Status
Change from base Build 886: 0.05%
Covered Lines: 882
Relevant Lines: 1526

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@a-b-r-o-w-n a-b-r-o-w-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I mostly just have questions, but a couple of suggestions as well.

Comment thread packages/component/src/BasicWebChat.js
Comment thread packages/core/src/sagas/connectSaga.js Outdated
Comment thread packages/core/src/sagas/connectSaga.js
Comment thread packages/core/src/sagas/connectSaga.js Outdated
Comment thread packages/core/src/sagas/connectSaga.js Outdated
fetch,
token: directLineToken,
webSocket: webSocket === 'true' || +webSocket
webSocket: webSocket === 'true' || !!+webSocket
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just be Boolean(webSocket)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today, it is either ?ws=true, ?ws=0 or ?ws=1. Otherwise, if we are treating it as boolean, I think we could just do webSocket !== 'false' (non-true/false, will by default turns to true).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I specifically mean !!+webSocket can be Boolean(webSocket)

Comment thread packages/playground/src/App.js
Comment thread packages/playground/src/App.js
@compulim compulim force-pushed the feat-rework-connect-saga branch from 99888fb to 2e64d55 Compare January 29, 2019 03:25
@compulim compulim force-pushed the feat-rework-connect-saga branch from 000730e to c3c02dd Compare January 30, 2019 06:30
@compulim compulim merged commit 17b253d into microsoft:master Jan 30, 2019
@compulim compulim deleted the feat-rework-connect-saga branch January 30, 2019 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants