{"action":"opened","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":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-10T13:41:27Z","updated_at":"2016-10-10T13:41:27Z","closed_at":null,"body":"Using the following example, the task complete event never fires.\r\n\r\n```\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```"}}
{"actor":{"display_login":"3rror404"}}