Skip to content

Commit

Permalink
Use StarScream branch which prevents multiple URLSession creation
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal committed Mar 27, 2024
1 parent 8d1361d commit f5547e7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
},
{
"package": "Starscream",
"repositoryURL": "https://github.com/daltoniam/Starscream",
"repositoryURL": "https://github.com/bgoncal/Starscream",
"state": {
"branch": null,
"revision": "df8d82047f6654d8e4b655d1b1525c64e1059d21",
"version": "4.0.4"
"branch": "ha-URLSession-fix",
"revision": "7e3d24425c20649105cb4bdd612b6bab66f73ade",
"version": null
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public let package = Package(
],
dependencies: [
.package(
url: "https://github.com/daltoniam/Starscream",
from: "4.0.4"
url: "https://github.com/bgoncal/Starscream",
.branchItem("ha-URLSession-fix")
),
.package(
url: "https://github.com/mxcl/PromiseKit",
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/HAConnectionImpl+Responses.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Starscream

extension HAConnectionImpl: Starscream.WebSocketDelegate {
func didReceive(event: Starscream.WebSocketEvent, client: Starscream.WebSocket) {
func didReceive(event: Starscream.WebSocketEvent, client: any Starscream.WebSocketClient) {
responseController.didReceive(event: event)
}
}
Expand Down
2 changes: 2 additions & 0 deletions Source/Internal/ResponseController/HAResponseController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ internal class HAResponseControllerImpl: HAResponseController {
case let .error(error):
HAGlobal.log(.error, "Error: \(String(describing: error))")
phase = .disconnected(error: error, forReset: false)
case .peerClosed:
HAGlobal.log(.info, "Peer closed")

Check warning on line 128 in Source/Internal/ResponseController/HAResponseController.swift

View check run for this annotation

Codecov / codecov/patch

Source/Internal/ResponseController/HAResponseController.swift#L128

Added line #L128 was not covered by tests
}
}

Expand Down

0 comments on commit f5547e7

Please sign in to comment.