From e1b65e036f9997f80745adb9c47012372d37135c Mon Sep 17 00:00:00 2001 From: KaylaBrady <31781298+KaylaBrady@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:11:07 -0400 Subject: [PATCH] tmp: back out other changes --- Sources/SwiftPhoenixClient/PhoenixTransport.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/SwiftPhoenixClient/PhoenixTransport.swift b/Sources/SwiftPhoenixClient/PhoenixTransport.swift index 6a6341fe..79209c44 100644 --- a/Sources/SwiftPhoenixClient/PhoenixTransport.swift +++ b/Sources/SwiftPhoenixClient/PhoenixTransport.swift @@ -229,7 +229,7 @@ open class URLSessionTransport: NSObject, PhoenixTransport, URLSessionWebSocketD self.readyState = .closing self.task?.cancel(with: closeCode, reason: reason?.data(using: .utf8)) - self.session?.invalidateAndCancel() + self.session?.finishTasksAndInvalidate() } open func send(data: Data) { @@ -267,12 +267,12 @@ open class URLSessionTransport: NSObject, PhoenixTransport, URLSessionWebSocketD // if this was caused by an error. guard let err = error else { return } - if let nsError = err as NSError? { + // if let nsError = err as NSError? { // If the client cancels a task, don't treat it as an abnormal error - if nsError.domain == "NSURLErrorDomain" && nsError.code == NSURLErrorCancelled { - return - } - } + // if nsError.domain == "NSURLErrorDomain" && nsError.code == NSURLErrorCancelled { + // return + // } + // } self.abnormalErrorReceived(err, response: task.response) }