{"action":"created","issue":{"url":"https://api.github.com/repos/dropbox/dropbox-sdk-obj-c/issues/69","repository_url":"https://api.github.com/repos/dropbox/dropbox-sdk-obj-c","labels_url":"https://api.github.com/repos/dropbox/dropbox-sdk-obj-c/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/dropbox/dropbox-sdk-obj-c/issues/69/comments","events_url":"https://api.github.com/repos/dropbox/dropbox-sdk-obj-c/issues/69/events","html_url":"https://github.com/dropbox/dropbox-sdk-obj-c/issues/69","id":193758659,"number":69,"title":"Download attempt while offline - unexpected behavior, plus null data retrieved - that's an error","user":{"login":"Twv","id":7013071,"avatar_url":"https://avatars.githubusercontent.com/u/7013071?v=3","gravatar_id":"","url":"https://api.github.com/users/Twv","html_url":"https://github.com/Twv","followers_url":"https://api.github.com/users/Twv/followers","following_url":"https://api.github.com/users/Twv/following{/other_user}","gists_url":"https://api.github.com/users/Twv/gists{/gist_id}","starred_url":"https://api.github.com/users/Twv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Twv/subscriptions","organizations_url":"https://api.github.com/users/Twv/orgs","repos_url":"https://api.github.com/users/Twv/repos","events_url":"https://api.github.com/users/Twv/events{/privacy}","received_events_url":"https://api.github.com/users/Twv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-12-06T12:21:23Z","updated_at":"2016-12-08T18:51:17Z","closed_at":null,"body":"I would like to ask what the expected behavior is when attempting download. E.g. below example:\r\n```objectivec\r\nDBDownloadDataTask *dTask = [client.filesRoutes downloadData:file];\r\n[dTask response:^(DBFILESFileMetadata* _Nullable result, DBFILESDownloadError* _Nullable routeError, DBRequestError * _Nullable error, NSData * _Nonnull data) {\r\n     ....handle response....\r\n}];\r\n```\r\nI am testing a scenario where device has a working connection at the beginning and retrieves a list of files. But after a while, the connection drops for some reason. (I turn on airplane mode on the debug device).\r\n\r\nAn attempt to download a file is made. What is the expected result when attempting a download without connection (calling code above)?\r\n\r\nWhat happens is:\r\n- The task waits until the connection is re-established. No timeout or error occurs, no matter how long I let the task wait.\r\n- When connection is re-established (I turn off the airplane mode), response arrives... but NSData * _Nonnull data parameter contains no content. routeError, error are both nil also.\r\n\r\nI expected the response to be called immediately and an error (no connection) would be reported.\r\nSuch behavior is for example observed when listing files:\r\n```objectivec\r\nNSNumber *includeMediaInfo = [NSNumber numberWithBool:YES];\r\n[[client.filesRoutes listFolder:cloudPath recursive:nil includeMediaInfo:includeMediaInfo includeDeleted:nil includeHasExplicitSharedMembers:nil]\r\n   response:^(DBFILESListFolderResult * _Nullable result, DBFILESListFolderError * _Nullable routeError, DBRequestError * _Nullable error) {\r\n     ....handle response....\r\n}];\r\n```\r\nIf the above code is attempted when Airplane mode is turned on, response is triggered immediately and an error is reported.\r\n\r\nI tried to debug the code - when list is called with airplane mode on, code steps into Shared/Handwritten/Networking/DBDelegate.m:\r\n```objectivec\r\n- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error\r\n```\r\nBut when the same scenario is repeated for download, this function is never called.\r\n\r\nI don't know if this is by design or not. But I'd kind of need to know how to handle such requests - I don't want the UI to keep waiting on a download that will never arrive and I'd hate to have to implement a parallel connectivity/timeout checking.\r\n\r\nTLDR - what is the expected result when calling download with airplane mode on?\r\nAfter the airplane mode is turned off, the response is triggered, but no data is received.\r\n\r\nEdit: I'm using api version from today's github master (54b1f8f).\r\n\r\nBR, Jan."},"comment":{"url":"https://api.github.com/repos/dropbox/dropbox-sdk-obj-c/issues/comments/265821673","html_url":"https://github.com/dropbox/dropbox-sdk-obj-c/issues/69#issuecomment-265821673","issue_url":"https://api.github.com/repos/dropbox/dropbox-sdk-obj-c/issues/69","id":265821673,"user":{"login":"xaphod","id":3776302,"avatar_url":"https://avatars.githubusercontent.com/u/3776302?v=3","gravatar_id":"","url":"https://api.github.com/users/xaphod","html_url":"https://github.com/xaphod","followers_url":"https://api.github.com/users/xaphod/followers","following_url":"https://api.github.com/users/xaphod/following{/other_user}","gists_url":"https://api.github.com/users/xaphod/gists{/gist_id}","starred_url":"https://api.github.com/users/xaphod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xaphod/subscriptions","organizations_url":"https://api.github.com/users/xaphod/orgs","repos_url":"https://api.github.com/users/xaphod/repos","events_url":"https://api.github.com/users/xaphod/events{/privacy}","received_events_url":"https://api.github.com/users/xaphod/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T18:51:17Z","updated_at":"2016-12-08T18:51:17Z","body":"haha when comments collide...."}}
{"actor":{"display_login":"xaphod"}}