Skip to content

Commit 305792b

Browse files
lsmilek1cbaker6
andauthored
LiveQuery: automatically try to reconnect after errors -1001 and -1011 (#217)
* Adding following codes to check for LiveQuery reconnection: -1001 "The request timed out." -1011 "There was a bad response from the server." * Adding description to the changelog reducing code length * Update CHANGELOG.md Co-authored-by: Corey <[email protected]> Co-authored-by: Corey <[email protected]>
1 parent 16cbcfa commit 305792b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### main
44
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.9.4...main)
55
* _Contributing to this repo? Add info about your change here to be included in the next release_
6+
- LiveQuery web socket connections handle URL error codes -1001 "The request timed out" and -1011 "There was a bad response from the server." ([#217](https://github.com/parse-community/Parse-Swift/pull/217)), thanks to [Lukas Smilek](https://github.com/lsmilek1).
67

78
### 1.9.4
89
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.9.3...1.9.4)

Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ extension ParseLiveQuery: LiveQuerySocketDelegate {
536536
}
537537
return false
538538
}
539-
if urlError.errorCode == -1005 {
539+
if [-1001, -1005, -1011].contains(urlError.errorCode) {
540540
isSocketEstablished = false
541541
open(isUserWantsToConnect: false) { error in
542542
guard let error = error else {

0 commit comments

Comments
 (0)