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

Let WebSocketClient take in a disconnection callback #1291

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

ckkashyap
Copy link
Contributor

WebSocketClient does not give an opportunity for the caller to handle disconnects. This PR changes the constructor to accept a callback thats invoked by WebSocketClient upon disconnect. This allows the caller decide the reconnect policy.

@ckkashyap ckkashyap requested a review from DDEfromOR October 11, 2019 17:09
@coveralls
Copy link

coveralls commented Oct 11, 2019

Pull Request Test Coverage Report for Build 83037

  • 1 of 5 (20.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 86.976%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botframework-streaming-extensions/src/WebSocket/WebSocketClient.ts 1 5 20.0%
Totals Coverage Status
Change from base Build 82785: -0.01%
Covered Lines: 4743
Relevant Lines: 5241

💛 - Coveralls

Copy link
Member

@DDEfromOR DDEfromOR left a comment

Choose a reason for hiding this comment

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

LGTM, the auto reconnect was more of an idea than a feature and having it be managed higher up allows for more flexibility around the reason for the disconnect, which could be important in different use cases of the client. This is also closer to the event emitter pattern used in the C# library.

@DDEfromOR DDEfromOR requested a review from compulim October 11, 2019 21:14
@DDEfromOR
Copy link
Member

Requesting a review from @compulim for his JS expertise.

@ckkashyap
Copy link
Contributor Author

I'm going ahead and merging since this change does not impact any existing user except DirectLineJS and I need need this change to unblock myself.

@ckkashyap ckkashyap closed this Oct 11, 2019
@ckkashyap ckkashyap reopened this Oct 11, 2019
@ckkashyap ckkashyap merged commit 1fe68b7 into master Oct 11, 2019
@stevengum stevengum deleted the ckk/streaming-extensions-fixes branch October 24, 2019 20:23
@stevengum stevengum restored the ckk/streaming-extensions-fixes branch October 24, 2019 20:23
@stevengum stevengum deleted the ckk/streaming-extensions-fixes branch October 24, 2019 20:23
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