{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/nativescript-background-http/issues/26","repository_url":"https://api.github.com/repos/NativeScript/nativescript-background-http","labels_url":"https://api.github.com/repos/NativeScript/nativescript-background-http/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-background-http/issues/26/comments","events_url":"https://api.github.com/repos/NativeScript/nativescript-background-http/issues/26/events","html_url":"https://github.com/NativeScript/nativescript-background-http/issues/26","id":182017706,"number":26,"title":"Complete event doesn't fire on Android","user":{"login":"3rror404","id":1102402,"avatar_url":"https://avatars.githubusercontent.com/u/1102402?v=3","gravatar_id":"","url":"https://api.github.com/users/3rror404","html_url":"https://github.com/3rror404","followers_url":"https://api.github.com/users/3rror404/followers","following_url":"https://api.github.com/users/3rror404/following{/other_user}","gists_url":"https://api.github.com/users/3rror404/gists{/gist_id}","starred_url":"https://api.github.com/users/3rror404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3rror404/subscriptions","organizations_url":"https://api.github.com/users/3rror404/orgs","repos_url":"https://api.github.com/users/3rror404/repos","events_url":"https://api.github.com/users/3rror404/events{/privacy}","received_events_url":"https://api.github.com/users/3rror404/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NativeScript/nativescript-background-http/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"tsonevn","id":17448734,"avatar_url":"https://avatars.githubusercontent.com/u/17448734?v=3","gravatar_id":"","url":"https://api.github.com/users/tsonevn","html_url":"https://github.com/tsonevn","followers_url":"https://api.github.com/users/tsonevn/followers","following_url":"https://api.github.com/users/tsonevn/following{/other_user}","gists_url":"https://api.github.com/users/tsonevn/gists{/gist_id}","starred_url":"https://api.github.com/users/tsonevn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsonevn/subscriptions","organizations_url":"https://api.github.com/users/tsonevn/orgs","repos_url":"https://api.github.com/users/tsonevn/repos","events_url":"https://api.github.com/users/tsonevn/events{/privacy}","received_events_url":"https://api.github.com/users/tsonevn/received_events","type":"User","site_admin":false},"assignees":[{"login":"tsonevn","id":17448734,"avatar_url":"https://avatars.githubusercontent.com/u/17448734?v=3","gravatar_id":"","url":"https://api.github.com/users/tsonevn","html_url":"https://github.com/tsonevn","followers_url":"https://api.github.com/users/tsonevn/followers","following_url":"https://api.github.com/users/tsonevn/following{/other_user}","gists_url":"https://api.github.com/users/tsonevn/gists{/gist_id}","starred_url":"https://api.github.com/users/tsonevn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsonevn/subscriptions","organizations_url":"https://api.github.com/users/tsonevn/orgs","repos_url":"https://api.github.com/users/tsonevn/repos","events_url":"https://api.github.com/users/tsonevn/events{/privacy}","received_events_url":"https://api.github.com/users/tsonevn/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-10-10T13:41:27Z","updated_at":"2016-10-12T10:09:35Z","closed_at":null,"body":"Using the following example, the task complete event never fires.\r\n\r\n``` javascript\r\nfunction uploadImage(filePath) {\r\n    var request = {\r\n        url: \"http://httpbin.org/post\",\r\n        method: \"POST\",\r\n        headers: {\r\n            \"Content-Type\": \"application/octet-stream\",\r\n            \"File-Name\": \"Test.png\"\r\n        },\r\n        description: \"{ 'uploading': \" + \"Test.png\" + \" }\"\r\n    };\r\n\r\n    var task = session.uploadFile(filePath, request);\r\n    task.on(\"progress\", logEvent);\r\n    task.on(\"error\", logEvent);\r\n    task.on(\"complete\", uploadComplete);\r\n\r\n    function logEvent(e) {\r\n        console.log(\"----------------\");\r\n        console.log('Status: ' + e.eventName);\r\n        if (e.totalBytes !== undefined) {\r\n            console.log('current bytes transfered: ' + e.currentBytes);\r\n            console.log('Total bytes to transfer: ' + e.totalBytes);\r\n        }\r\n    }\r\n\r\n    function uploadComplete() {\r\n        console.log('Upload complete');\r\n    }\r\n}\r\n```\r\n\r\nI see some progress updates in the console and I receive a local notification but the `uploadComplete` function is never called.\r\n\r\n```\r\nJS: onProgress\r\nJS: ----------------\r\nJS: Status: progress\r\nJS: current bytes transfered: 4096\r\nJS: Total bytes to transfer: 2700129\r\nJS: onProgress\r\nJS: ----------------\r\nJS: Status: progress\r\nJS: current bytes transfered: 720896\r\nJS: Total bytes to transfer: 2700129\r\nJS: onProgress\r\nJS: ----------------\r\nJS: Status: progress\r\nJS: current bytes transfered: 1376256\r\nJS: Total bytes to transfer: 2700129\r\nJS: onProgress\r\nJS: ----------------\r\nJS: Status: progress\r\nJS: current bytes transfered: 1769472\r\nJS: Total bytes to transfer: 2700129\r\nJS: onProgress\r\nJS: ----------------\r\nJS: Status: progress\r\nJS: current bytes transfered: 2555904\r\nJS: Total bytes to transfer: 2700129\r\n```\r\n\r\nThe same code works fine on iOS.\r\n\r\n```\r\n┌──────────────────┬───────────────────────┬────────────────┬─────────────┐\r\n│ Component        │ Current version       │ Latest version │ Information │\r\n│ nativescript     │ 2.3.0                 │ 2.3.0          │ Up to date  │\r\n│ tns-core-modules │ 2.4.0-2016-10-07-4335 │ 2.3.0          │ Up to date  │\r\n│ tns-android      │ 2.3.0                 │ 2.3.0          │ Up to date  │\r\n│ tns-ios          │ 2.3.0                 │ 2.3.0          │ Up to date  │\r\n└──────────────────┴───────────────────────┴────────────────┴─────────────┘\r\n```"},"comment":{"url":"https://api.github.com/repos/NativeScript/nativescript-background-http/issues/comments/253173118","html_url":"https://github.com/NativeScript/nativescript-background-http/issues/26#issuecomment-253173118","issue_url":"https://api.github.com/repos/NativeScript/nativescript-background-http/issues/26","id":253173118,"user":{"login":"tsonevn","id":17448734,"avatar_url":"https://avatars.githubusercontent.com/u/17448734?v=3","gravatar_id":"","url":"https://api.github.com/users/tsonevn","html_url":"https://github.com/tsonevn","followers_url":"https://api.github.com/users/tsonevn/followers","following_url":"https://api.github.com/users/tsonevn/following{/other_user}","gists_url":"https://api.github.com/users/tsonevn/gists{/gist_id}","starred_url":"https://api.github.com/users/tsonevn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsonevn/subscriptions","organizations_url":"https://api.github.com/users/tsonevn/orgs","repos_url":"https://api.github.com/users/tsonevn/repos","events_url":"https://api.github.com/users/tsonevn/events{/privacy}","received_events_url":"https://api.github.com/users/tsonevn/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T10:09:35Z","updated_at":"2016-10-12T10:09:35Z","body":"Hi @3rror404,\r\nI reviewed your issue and found that this problem could be reproduced, when you try to upload image with large size. We will research, what is causing this problem for Android. Regarding to that I am attaching [link](https://github.com/tsonevn/NSBackgourndHTTP_issue26) to a sample project, where the problem could be reproduced."}}
{"actor":{"display_login":"tsonevn"}}