kean / Pulse

Network logger for Apple platforms
https://pulselogger.com
MIT License
6.18k stars 294 forks source link

Fix task description not being used with URLSessionProxyDelegate #255

Closed alexjameslittle closed 3 months ago

alexjameslittle commented 3 months ago

We are using the URLSessionProxyDelegate to record network tasks to pulse. #254 introduced task description support for custom titles, however this was not working with URLSessionProxyDelegate as the URLSessionDataTask didn't have a taskDescription in func urlSession(_ session: URLSession, didCreateTask task: URLSessionTask) as it is added directly after creation like below:

dataTask = self.dataTask(with: request) { data, response, error in

}
dataTask?.taskDescription = taskDescription
dataTask?.resume()
kean commented 3 months ago

Great catch, thank you! I tested it only with mocks.