When downloading/uploading multiple blobs, the progress is only reported back for one task. This is because when a URLSession (iOS) is started, it uses the config based on a task id and, when it does this, it attempts to enable progress reporting for all other tasks, after which it removes the tasks from the dictionary of tasks to be enabled. Because of a race condition, this actually makes it so that only the first task for which progress reporting is enabled actually reports progress. This PR fixes that issue by handling this process on a case-by-case basis and only removes pending tasks after they have been moved to the dictionary of enabled tasks.
When downloading/uploading multiple blobs, the progress is only reported back for one task. This is because when a URLSession (iOS) is started, it uses the config based on a task id and, when it does this, it attempts to enable progress reporting for all other tasks, after which it removes the tasks from the dictionary of tasks to be enabled. Because of a race condition, this actually makes it so that only the first task for which progress reporting is enabled actually reports progress. This PR fixes that issue by handling this process on a case-by-case basis and only removes pending tasks after they have been moved to the dictionary of enabled tasks.