I am experiencing some weird behaviour when using an uploadTask
for a URLSessionConfiguration.background
.
My custom delegate is implementing all of the delegate methods that belong to URLSessionDelegate
, URLSessionTaskDelegate
, and URLSessionDataDelegate
. All of them has a print
statement indicating that the method has been called.
I am trying to upload five images to a server, each of them has their own session with an id matching the image id.
The problem is that when uploading using a very slow connection "edge", the upload progress will reset before reaching 100% This happens whenever didFinishCollectingMetrics
is called as you can see here: Data
This does not happen all the time when using a slow connection but only some of the time.
Anyone got any ideas as to what is happening here?