Skip to content

fix(WebSocketSubject): fix subject failing to close socket - #4446

Merged
benlesh merged 1 commit into
ReactiveX:masterfrom
rsikdar:websocket
Jan 29, 2019
Merged

benlesh merged 1 commit into
ReactiveX:masterfrom
rsikdar:websocket

Conversation

@rsikdar

@rsikdar rsikdar commented Jan 2, 2019 •

Copy link
Copy Markdown
Contributor

Description:
Fix WebSocketSubject failing to close the underlying socket connection when it is unsubscribed
before the socket is in the open state. Currently, when unsubscribe is called on the subject or
when a subscription is unsubscribed there are checks on whether the socket is open (readyState = 1)
before it closes the connection. If unsubscribe is called before the connection is open, it will not
close the socket but will reset the state of the subject (_socket set to null), and it becomes
impossible to close the socket.

Related issue (if exists): #4447

Fix WebSocketSubject failing to close the underlying socket connection when it is unsubscribed
before the socket is in the open state. Currently, when unsubscribe is called on the subject or
when a subscription is unsubscribed there are checks on whether the socket is open (readyState = 1)
before it closes the connection. If unsubscribe is called before the connection is open, it will not
close the socket but will reset the state of the subject (_socket set to null), and it becomes
impossible to close the socket.
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 7832

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 96.807%

Totals Coverage Status
Change from base Build 7818: 0.002%
Covered Lines: 5245
Relevant Lines: 5418

💛 - Coveralls

@cartant cartant left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@benlesh
benlesh merged commit dcfa52b into ReactiveX:master Jan 29, 2019
@benlesh

benlesh commented Jan 29, 2019

Copy link
Copy Markdown
Member

Thank you, @rsikdar!

@lock lock Bot locked as resolved and limited conversation to collaborators Mar 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants