From 4372b5b5b2aa9b103e1ecf2554de193d22602e43 Mon Sep 17 00:00:00 2001 From: Eric Jensen Date: Tue, 28 May 2024 13:19:24 -0400 Subject: [PATCH 1/2] Include the request URL in the taskDescription values --- Sources/Nuke/Loading/DataLoader.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Nuke/Loading/DataLoader.swift b/Sources/Nuke/Loading/DataLoader.swift index e2359ebe9..744ca71a1 100644 --- a/Sources/Nuke/Loading/DataLoader.swift +++ b/Sources/Nuke/Loading/DataLoader.swift @@ -97,7 +97,7 @@ public final class DataLoader: DataLoading, @unchecked Sendable { if #available(iOS 14.5, tvOS 14.5, watchOS 7.4, macOS 11.3, *) { task.prefersIncrementalDelivery = prefersIncrementalDelivery } - return impl.loadData(with: task, session: session, didReceiveData: didReceiveData, completion: completion) + return impl.loadData(with: task, request: request, session: session, didReceiveData: didReceiveData, completion: completion) } /// Errors produced by ``DataLoader``. @@ -124,6 +124,7 @@ private final class _DataLoader: NSObject, URLSessionDataDelegate { /// Loads data with the given request. func loadData(with task: URLSessionDataTask, + request: URLRequest, session: URLSession, didReceiveData: @escaping (Data, URLResponse) -> Void, completion: @escaping (Error?) -> Void) -> any Cancellable { @@ -131,7 +132,7 @@ private final class _DataLoader: NSObject, URLSessionDataDelegate { session.delegateQueue.addOperation { // `URLSession` is configured to use this same queue self.handlers[task] = handler } - task.taskDescription = "Nuke Load Data" + task.taskDescription = "Nuke Load Data \(request)" task.resume() return AnonymousCancellable { task.cancel() } } From 0a1611af47f108b1e1d400defacee9e1f57bb909 Mon Sep 17 00:00:00 2001 From: Eric Jensen Date: Tue, 28 May 2024 15:00:50 -0400 Subject: [PATCH 2/2] Remove the assignment of taskDescription --- Sources/Nuke/Loading/DataLoader.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/Nuke/Loading/DataLoader.swift b/Sources/Nuke/Loading/DataLoader.swift index 744ca71a1..0fdf8a00a 100644 --- a/Sources/Nuke/Loading/DataLoader.swift +++ b/Sources/Nuke/Loading/DataLoader.swift @@ -97,7 +97,7 @@ public final class DataLoader: DataLoading, @unchecked Sendable { if #available(iOS 14.5, tvOS 14.5, watchOS 7.4, macOS 11.3, *) { task.prefersIncrementalDelivery = prefersIncrementalDelivery } - return impl.loadData(with: task, request: request, session: session, didReceiveData: didReceiveData, completion: completion) + return impl.loadData(with: task, session: session, didReceiveData: didReceiveData, completion: completion) } /// Errors produced by ``DataLoader``. @@ -124,7 +124,6 @@ private final class _DataLoader: NSObject, URLSessionDataDelegate { /// Loads data with the given request. func loadData(with task: URLSessionDataTask, - request: URLRequest, session: URLSession, didReceiveData: @escaping (Data, URLResponse) -> Void, completion: @escaping (Error?) -> Void) -> any Cancellable { @@ -132,7 +131,6 @@ private final class _DataLoader: NSObject, URLSessionDataDelegate { session.delegateQueue.addOperation { // `URLSession` is configured to use this same queue self.handlers[task] = handler } - task.taskDescription = "Nuke Load Data \(request)" task.resume() return AnonymousCancellable { task.cancel() } }