File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Sources/ParseSwift/LiveQuery Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -525,7 +525,7 @@ extension ParseLiveQuery {
525
525
self . createTask ( )
526
526
self . attempts += 1
527
527
let error = ParseError ( code: . unknownError,
528
- message: " Attempted to open socket \( self . attempts) " )
528
+ message: " Attempted to open socket \( self . attempts) time(s) " )
529
529
completion ( error)
530
530
}
531
531
}
@@ -561,7 +561,13 @@ extension ParseLiveQuery {
561
561
*/
562
562
public func sendPing( pongReceiveHandler: @escaping ( Error ? ) -> Void ) {
563
563
synchronizationQueue. sync {
564
- URLSession . liveQuery. sendPing ( task, pongReceiveHandler: pongReceiveHandler)
564
+ if isSocketEstablished {
565
+ URLSession . liveQuery. sendPing ( task, pongReceiveHandler: pongReceiveHandler)
566
+ } else {
567
+ let error = ParseError ( code: . unknownError,
568
+ message: " Need to open the websocket before it can be pinged. " )
569
+ pongReceiveHandler ( error)
570
+ }
565
571
}
566
572
}
567
573
You can’t perform that action at this time.
0 commit comments