{"action":"created","issue":{"url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1052","repository_url":"https://api.github.com/repos/Alamofire/Alamofire","labels_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1052/labels{/name}","comments_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1052/comments","events_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1052/events","html_url":"https://github.com/Alamofire/Alamofire/issues/1052","id":131880685,"number":1052,"title":"Reconnecting to In Progress Background Transfers","user":{"login":"ronak2121","id":1755751,"avatar_url":"https://avatars.githubusercontent.com/u/1755751?v=3","gravatar_id":"","url":"https://api.github.com/users/ronak2121","html_url":"https://github.com/ronak2121","followers_url":"https://api.github.com/users/ronak2121/followers","following_url":"https://api.github.com/users/ronak2121/following{/other_user}","gists_url":"https://api.github.com/users/ronak2121/gists{/gist_id}","starred_url":"https://api.github.com/users/ronak2121/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronak2121/subscriptions","organizations_url":"https://api.github.com/users/ronak2121/orgs","repos_url":"https://api.github.com/users/ronak2121/repos","events_url":"https://api.github.com/users/ronak2121/events{/privacy}","received_events_url":"https://api.github.com/users/ronak2121/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Alamofire/Alamofire/labels/question","name":"question","color":"FF7E00"},{"url":"https://api.github.com/repos/Alamofire/Alamofire/labels/url%20session","name":"url session","color":"69B805"}],"state":"closed","locked":false,"assignee":{"login":"cnoon","id":169110,"avatar_url":"https://avatars.githubusercontent.com/u/169110?v=3","gravatar_id":"","url":"https://api.github.com/users/cnoon","html_url":"https://github.com/cnoon","followers_url":"https://api.github.com/users/cnoon/followers","following_url":"https://api.github.com/users/cnoon/following{/other_user}","gists_url":"https://api.github.com/users/cnoon/gists{/gist_id}","starred_url":"https://api.github.com/users/cnoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnoon/subscriptions","organizations_url":"https://api.github.com/users/cnoon/orgs","repos_url":"https://api.github.com/users/cnoon/repos","events_url":"https://api.github.com/users/cnoon/events{/privacy}","received_events_url":"https://api.github.com/users/cnoon/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-02-06T17:53:03Z","updated_at":"2016-02-09T05:30:31Z","closed_at":"2016-02-06T19:36:00Z","body":"Hi,\r\n\r\nI have a question regarding how Alamofire works with in progress background transfers.\r\n\r\nSo, imagine this scenario:\r\n\r\n1. User opens up your app\r\n2. User queues up a collection of background transfers\r\n3. User backgrounds your app\r\n4. User launches other apps enough to force the system to terminate your app\r\n5. User relaunches your app while at least one of your previous background transfers were running.\r\n\r\nSome questions here:\r\n\r\n1. Is this a realistic edge case?\r\n2. It looks like the existing Alamofire SessionDelegate multiplexes the delegate callbacks based on taskIdentifiers instead of by URL, which means that client code would have to recreate the tasks that were running apriori in order to match up by taskIdentifier again. (Seems like a very hacky, buggy solution).\r\n3. Apps would have to check at app launch to see if there are any background transfers that are running, and override Alamofire's SessionDelegate using the blocks.\r\n\r\nThe question I have with number 3 is if we should be removing the override once all background transfers have completed? What happens if the user starts new ones? In this scenario, it seems like I would be working around Alamofire's code a lot...\r\n\r\nThanks,\r\n\r\nRonak"},"comment":{"url":"https://api.github.com/repos/Alamofire/Alamofire/issues/comments/181716434","html_url":"https://github.com/Alamofire/Alamofire/issues/1052#issuecomment-181716434","issue_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1052","id":181716434,"user":{"login":"cnoon","id":169110,"avatar_url":"https://avatars.githubusercontent.com/u/169110?v=3","gravatar_id":"","url":"https://api.github.com/users/cnoon","html_url":"https://github.com/cnoon","followers_url":"https://api.github.com/users/cnoon/followers","following_url":"https://api.github.com/users/cnoon/following{/other_user}","gists_url":"https://api.github.com/users/cnoon/gists{/gist_id}","starred_url":"https://api.github.com/users/cnoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnoon/subscriptions","organizations_url":"https://api.github.com/users/cnoon/orgs","repos_url":"https://api.github.com/users/cnoon/repos","events_url":"https://api.github.com/users/cnoon/events{/privacy}","received_events_url":"https://api.github.com/users/cnoon/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T05:30:31Z","updated_at":"2016-02-09T05:30:31Z","body":"I don't understand your reasoning here @ronak2121. First off, I don't understand what you mean by multiplexing in #1. As for #2, I don't understand what that accomplishes. Additionally, recreating requests is only easy if you have them completely abstracted and all callbacks are done using a delegate pattern, not closures."}}