Our concern is specifically about NSURLSession background sessions. We are starting (I'd say in the past 4 weeks) to have reports from users that various POST operations that happen via background sessions using uploadTask(with:fromFile:) are not completing successfully. We have an app-specific toggle that lets us disable the use of background sessions; when the users flip that toggle and now start using standard sessions only, their POST requests succeed.
FWIW, though we originally were using Alamofire, I rewrote our code to use NSURLSession directly last week, and we continued to have users who report upload issues. This suggests to me that we have a deeper issue/regression for some users and/or devices that use background sessions. Thus, I am wondering if, for example, a mis-use of the Caches vs the Temp directory on a device with storage constraints, for example, could explain this behavior.
Also note that we use background sessions for all POST operations because we want them to continue even if the user backgrounds the app. For example, the user sends a chat message then immediately backgrounds us; we want that to complete successfully, so we do all chat POST operations via background sessions. Perhaps using background NSURLSession while the app is foregrounded is itself mistaken?
Topic:
App & System Services
SubTopic:
Core OS
Tags: