Skip to content

Commit

Permalink
fix: transport.close must call ws.close even if not connected
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Apr 10, 2024
1 parent 3a93cf6 commit 9512487
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## master

## 0.8.3 (2024-04-09)

- Fix closing WebSocket right after opening. ([@palkan][])

## 0.8.2 (2024-03-27)

- Fix whispering for pub/sub channels. ([@palkan][])
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anycable/core",
"version": "0.8.2",
"version": "0.8.3",
"description": "AnyCable JavaScript client library core functionality",
"keywords": [
"anycable",
Expand Down
4 changes: 3 additions & 1 deletion packages/core/websocket/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ export class WebSocketTransport {
}

close() {
if (this.ws && this.connected) {
if (this.ws) {
this.onclose()
} else {
this.connected = false
}
}

Expand Down

0 comments on commit 9512487

Please sign in to comment.