Skip to content

Commit

Permalink
fix: Compilation errors in ParseLiveQuery related to StarStream
Browse files Browse the repository at this point in the history
  • Loading branch information
dplewis committed Oct 5, 2023
1 parent 9fda428 commit 49d2b4d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 359 deletions.
11 changes: 9 additions & 2 deletions ParseLiveQuery/ParseLiveQuery/Internal/ClientPrivate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func == (first: Client.RequestId, second: Client.RequestId) -> Bool {
// ---------------

extension Client: WebSocketDelegate {
public func didReceive(event: WebSocketEvent, client: WebSocket) {
public func didReceive(event: WebSocketEvent, client: Starscream.WebSocketClient) {
switch event {

case .connected(_):
Expand All @@ -140,7 +140,7 @@ extension Client: WebSocketDelegate {
case .error(let error):
NSLog("ParseLiveQuery: Error processing message: \(String(describing: error))")
case .viabilityChanged(let isViable):
if shouldPrintWebSocketLog { NSLog("ParseLiveQuery: WebSocket viability channged to \(isViable ? "" : "not-")viable") }
if shouldPrintWebSocketLog { NSLog("ParseLiveQuery: WebSocket viability changed to \(isViable ? "" : "not-")viable") }
if !isViable {
isConnecting = false
}
Expand All @@ -161,6 +161,13 @@ extension Client: WebSocketDelegate {
if !userDisconnected {
reconnect()
}
case .peerClosed:
isConnecting = false
if shouldPrintWebSocketLog { NSLog("ParseLiveQuery: WebSocket connection closed...") }
// TODO: Better retry logic, unless `disconnect()` was explicitly called
if !userDisconnected {
reconnect()
}
case .pong(_):
if shouldPrintWebSocketLog { NSLog("ParseLiveQuery: Received pong but we don't handle it...") }
case .ping(_):
Expand Down
Loading

0 comments on commit 49d2b4d

Please sign in to comment.