Description
Hello!
I've encountered an issue with file uploads when using a background URLSession with the same identifier across multiple TUSClient instances.
Steps to Reproduce
Create two TUSClient instances using the same background URLSessionConfiguration (i.e., the same identifier).
Start an upload using the second TUSClient instance.
Problem Description
The issue arises because __NSURLBackgroundSession holds a strong reference to its delegate (TUSAPI). When a new URLSession is created in the second TUSAPI instance, it does not override the delegate of __NSURLBackgroundSession. And for some reason, the new URLSession uses the first TUSAPI instance as its delegate instead of the second one.
As a result, when starting an upload in the second TUSClient instance, the URLSession reports completions (func urlSession(_: URLSession:task:didCompleteWithError:)) to the TUSAPI belonging to the first TUSClient instance.
I'm unsure if this is intended behavior, but it seems we should not create multiple TUSClient instances when using a background session. It might be helpful to clarify this information in the documentation.