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

Use StarScream branch which prevents multiple URLSession creation #57

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
Copy link
Member Author

@bgoncal bgoncal Mar 27, 2024

Choose a reason for hiding this comment

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

Should I move phase to disconnected? (This new case comes from upgrading starscream from 4.0.4 to 4.0.6)

}
}

Expand Down