Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit dbf094c

Browse files
committed
Remove Progress.sessionTask
The API isn't used in neither the library nor the apps
1 parent e9afb31 commit dbf094c

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

WordPressKit/WordPressComRestApi.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ open class WordPressComRestApi: NSObject {
6363
@objc public static let LocaleKeyDefault = "locale" // locale is specified with this for v1 endpoints
6464
@objc public static let LocaleKeyV2 = "_locale" // locale is prefixed with an underscore for v2
6565

66-
@objc public static let SessionTaskKey = "WordPressComRestAPI.sessionTask"
67-
6866
public typealias RequestEnqueuedBlock = (_ taskID: NSNumber) -> Void
6967
public typealias SuccessResponseBlock = (_ responseObject: AnyObject, _ httpResponse: HTTPURLResponse?) -> Void
7068
public typealias FailureReponseBlock = (_ error: NSError, _ httpResponse: HTTPURLResponse?) -> Void
@@ -225,7 +223,6 @@ open class WordPressComRestApi: NSObject {
225223
failure(processedError ?? (error as NSError), response.response)
226224
}
227225
}).downloadProgress(closure: progressUpdater)
228-
progress.sessionTask = dataRequest.task
229226
progress.cancellationHandler = { [weak dataRequest] in
230227
dataRequest?.cancel()
231228
}
@@ -606,25 +603,6 @@ private extension WordPressComRestApi {
606603
}
607604
}
608605

609-
// MARK: - Progress
610-
611-
@objc extension Progress {
612-
613-
var sessionTask: URLSessionTask? {
614-
get {
615-
return userInfo[.sessionTaskKey] as? URLSessionTask
616-
}
617-
618-
set {
619-
self.setUserInfoObject(newValue, forKey: .sessionTaskKey)
620-
}
621-
}
622-
}
623-
624-
extension ProgressUserInfoKey {
625-
public static let sessionTaskKey = ProgressUserInfoKey(rawValue: WordPressComRestApi.SessionTaskKey)
626-
}
627-
628606
// MARK: - POST encoding
629607

630608
private extension Dictionary {

WordPressKit/WordPressOrgRestApi.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ open class WordPressOrgRestApi: NSObject, WordPressRestApi {
7070
}
7171

7272
}).downloadProgress(closure: progressUpdater)
73-
progress.sessionTask = dataRequest.task
7473
progress.cancellationHandler = {
7574
dataRequest.cancel()
7675
}

0 commit comments

Comments
 (0)