{"action":"created","issue":{"url":"https://api.github.com/repos/paddle8/ember-plupload/issues/22","labels_url":"https://api.github.com/repos/paddle8/ember-plupload/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/paddle8/ember-plupload/issues/22/comments","events_url":"https://api.github.com/repos/paddle8/ember-plupload/issues/22/events","html_url":"https://github.com/paddle8/ember-plupload/issues/22","id":87854266,"number":22,"title":"Multiple file upload failing when file plupload settings not set before file upload started","user":{"login":"walter","id":10767,"avatar_url":"https://avatars.githubusercontent.com/u/10767?v=3","gravatar_id":"","url":"https://api.github.com/users/walter","html_url":"https://github.com/walter","followers_url":"https://api.github.com/users/walter/followers","following_url":"https://api.github.com/users/walter/following{/other_user}","gists_url":"https://api.github.com/users/walter/gists{/gist_id}","starred_url":"https://api.github.com/users/walter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walter/subscriptions","organizations_url":"https://api.github.com/users/walter/orgs","repos_url":"https://api.github.com/users/walter/repos","events_url":"https://api.github.com/users/walter/events{/privacy}","received_events_url":"https://api.github.com/users/walter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-12T21:13:00Z","updated_at":"2015-06-15T02:03:20Z","closed_at":null,"body":"### Background\r\n\r\nMy app gets a S3 pre-signed upload URL from an API set up to do authorization before returning the URL. Sometimes this takes multiple tries to get authorization with a set delay between each retry due to the idiosyncrasies of our authorization rules. \r\n\r\nAs you may remember, I use slightly customized version of plupload to support the PUT method. Here's the branch with the modifications [for reference](https://github.com/lytbulb/plupload/tree/s3-required-modifications).\r\n\r\nOn this set up single uploads, ember-plupload (0.6.18) works reliably. The file specific settings (put method, url, content type header) are set correctly.\r\n\r\n### The Problem\r\n\r\nHowever, sometimes with multiple file uploads the file specific settings fail to be passed to plupload (I have verified this with logging in my app, ember-plupload, and in plupload) and the file upload starts with the default settings which then fails with `DOMException 12` because the URL is not present.\r\n\r\nI tracked down the issue to be due to the timing in this line:\r\n\r\nhttps://github.com/paddle8/ember-plupload/blob/master/addon/system/file.js#L154\r\n\r\nIf I up the number from 100 to 400 my multiple file uploads that were previously failing work reliably and I have verified that the settings in line 151 are indeed used by plupload whereas at 100 they we not being used by plupload.\r\n\r\nI must admit to being confused by why the settings taking effect is left to a matter of timing or even where the asynchronous failing of setting the settings in time is happening!\r\n\r\n### The Solution?\r\n\r\nRather than up the number to 400 (which would slow uploads down per file, of course), I'm wondering if we can somehow make sure that the settings are in place for plupload before proceeding with starting the uploader. Any ideas?\r\n\r\nHappy to talk through this on Skype or the like if that helps.\r\n"},"comment":{"url":"https://api.github.com/repos/paddle8/ember-plupload/issues/comments/111898561","html_url":"https://github.com/paddle8/ember-plupload/issues/22#issuecomment-111898561","issue_url":"https://api.github.com/repos/paddle8/ember-plupload/issues/22","id":111898561,"user":{"login":"opsb","id":46232,"avatar_url":"https://avatars.githubusercontent.com/u/46232?v=3","gravatar_id":"","url":"https://api.github.com/users/opsb","html_url":"https://github.com/opsb","followers_url":"https://api.github.com/users/opsb/followers","following_url":"https://api.github.com/users/opsb/following{/other_user}","gists_url":"https://api.github.com/users/opsb/gists{/gist_id}","starred_url":"https://api.github.com/users/opsb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opsb/subscriptions","organizations_url":"https://api.github.com/users/opsb/orgs","repos_url":"https://api.github.com/users/opsb/repos","events_url":"https://api.github.com/users/opsb/events{/privacy}","received_events_url":"https://api.github.com/users/opsb/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T02:03:20Z","updated_at":"2015-06-15T02:03:20Z","body":"@tim-evans your comment at https://github.com/paddle8/ember-plupload/blob/master/addon/system/file.js#L158 seems to imply that there's a newer version of plupload that includes the settings as part of the upload process. I couldn't find any mention of this in the plupload docs, you got a link?"}}