{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1623","repository_url":"https://api.github.com/repos/aws/aws-sdk-js","labels_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1623/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1623/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1623/events","html_url":"https://github.com/aws/aws-sdk-js/issues/1623","id":242376006,"node_id":"MDU6SXNzdWUyNDIzNzYwMDY=","number":1623,"title":"`httpUploadProgress` fires before the upload","user":{"login":"aichholzer","id":1402711,"node_id":"MDQ6VXNlcjE0MDI3MTE=","avatar_url":"https://avatars3.githubusercontent.com/u/1402711?v=4","gravatar_id":"","url":"https://api.github.com/users/aichholzer","html_url":"https://github.com/aichholzer","followers_url":"https://api.github.com/users/aichholzer/followers","following_url":"https://api.github.com/users/aichholzer/following{/other_user}","gists_url":"https://api.github.com/users/aichholzer/gists{/gist_id}","starred_url":"https://api.github.com/users/aichholzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aichholzer/subscriptions","organizations_url":"https://api.github.com/users/aichholzer/orgs","repos_url":"https://api.github.com/users/aichholzer/repos","events_url":"https://api.github.com/users/aichholzer/events{/privacy}","received_events_url":"https://api.github.com/users/aichholzer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-07-12T13:14:46Z","updated_at":"2018-11-29T00:41:19Z","closed_at":"2018-11-29T00:41:19Z","author_association":"NONE","body":"Running:\r\n`aws-sdk: 2.82.0`\r\n`node: 8.0.0` \r\n\r\n\r\nAs it would seem `httpUploadProgress` does not fire after the upload has been successful, but before it happens. Look at this code:\r\n```\r\nconst upload = new aws.S3.ManagedUpload({\r\n  partSize: 5 * 1024 * 1024,\r\n  queueSize: 8,\r\n  params: {\r\n    Bucket: 'BUCKET_NAME',\r\n    Key: 'file.dmg',\r\n    Body: fs.createReadStream('./file.dmg')\r\n  }\r\n});\r\n\r\nupload.on('httpUploadProgress', (event) => {\r\n  console.log(event.loaded * 100 / event.total);\r\n});\r\n\r\nupload.send((error, result) => {\r\n  console.log('Done');\r\n});\r\n```\r\n\r\n`file.dmg` has a size of 28.8 Mb.\r\n\r\nAfter about 1 second, this gets logged to the console:\r\n```\r\n19.569250155460217\r\n39.138500310920435\r\n58.70775046638065\r\n78.27700062184087\r\n97.8462507773011\r\n```\r\nthen, after about 10 seconds, this:\r\n```\r\n100\r\n```\r\nthen, after a few minutes, this;\r\n```\r\nDone\r\n```\r\n\r\nI would imagine that the whole idea behind the `httpUploadProgress` event is to track the upload progress in \"real time\", as it happens. As it's currently implemented, it does not have any use.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-js/issues/comments/442661255","html_url":"https://github.com/aws/aws-sdk-js/issues/1623#issuecomment-442661255","issue_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/1623","id":442661255,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjY2MTI1NQ==","user":{"login":"srchase","id":782571,"node_id":"MDQ6VXNlcjc4MjU3MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/782571?v=4","gravatar_id":"","url":"https://api.github.com/users/srchase","html_url":"https://github.com/srchase","followers_url":"https://api.github.com/users/srchase/followers","following_url":"https://api.github.com/users/srchase/following{/other_user}","gists_url":"https://api.github.com/users/srchase/gists{/gist_id}","starred_url":"https://api.github.com/users/srchase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srchase/subscriptions","organizations_url":"https://api.github.com/users/srchase/orgs","repos_url":"https://api.github.com/users/srchase/repos","events_url":"https://api.github.com/users/srchase/events{/privacy}","received_events_url":"https://api.github.com/users/srchase/received_events","type":"User","site_admin":false},"created_at":"2018-11-29T00:41:19Z","updated_at":"2018-11-29T00:41:19Z","author_association":"CONTRIBUTOR","body":"This was investigated further.  httpUploadProgress is triggered as an event when that part is sent.  It is not based on when the upload of a given part succeeds.\r\n\r\nhttpUploadProgress gives some approximation for working through large uploads, but may not give the full picture because of the timing of how those events are fired."}}
{"actor":{"display_login":"srchase"}}