Permalink
Browse files

fixed a race condition that led to incorrect upload progress feedback

  • Loading branch information...
1 parent 5cd3031 commit 9f67e6ebaf85d894fef32322ca205a31e6118821 @maxgillett committed Apr 7, 2013
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- s3_multipart (0.0.10)
+ s3_multipart (0.0.10.4)
uuid (>= 2.3.6)
xml-simple (>= 1.1.2)
View
@@ -6,6 +6,8 @@ Multipart uploading allows files to be split into many chunks and uploaded in pa
## What's New
+**0.0.10.4** - Fixed a race condition that led to incorrect upload progress feedback.
+
**0.0.10.3** - Fixed a bug that prevented 5-10mb files from being uploaded correctly.
**0.0.10.2** - Modifications made to the database table used by the gem are now handled by migrations. If you are upgrading versions, run `rails g s3_multipart:install_new_migrations` followed by `rake db:migrate`. Fresh installs do not require subsequent migrations. The current version must now also be passed in to the gem's configuration function to alert you of breaking changes. This is done by setting a revision yml variable. See the section regarding the aws.yml file in the readme section below (just before "Getting Started").
@@ -16,7 +16,9 @@ function UploadPart(blob, key, upload) {
upload.handler.onError(upload, part);
};
xhr.upload.onprogress = _.throttle(function(e) {
- upload.inprogress[key] = e.loaded;
+ if (upload.inprogress[key] != 0) {
+ upload.inprogress[key] = e.loaded;
+ }
}, 1000);
};
@@ -29,4 +31,4 @@ UploadPart.prototype.activate = function() {
UploadPart.prototype.pause = function() {
this.xhr.abort();
this.status = "paused";
-};
+};
@@ -89,4 +89,4 @@ def format_part_list_in_xml(options)
end
-end
+end
@@ -1,5 +1,5 @@
module S3Multipart
- VERSION = "0.0.10.3"
+ VERSION = "0.0.10.4"
BREAKING_CHANGES = {
:"0.0.10.2" => 'Modifications made to the database table used by the gem are now handled by migrations. If you are upgrading versions, run `rails g s3_multipart:install_new_migrations` followed by `rake db:migrate`. Fresh installs do not require subsequent migrations. The current version must now also be passed in to the gem\'s configuration function to alert you of breaking changes. This is done by setting a revision yml variable. See the section regarding the aws.yml file in the readme section below (just before "Getting Started").'
}
@@ -19,7 +19,7 @@ $(function() {
var file_list, s3mp;
$(".submit-button").click(function() {
- s3mp = new window.S3MP({
+ window.s3mp = new window.S3MP({
bucket: 'bitcast-bucket',
fileInputElement: "#uploader",
fileList: file_list,
@@ -6,7 +6,7 @@ class VideoUploader < ApplicationController
attach :video
# Only accept certain file types. Expects an array of valid extensions.
- accept %w(wmv avi mp4 mkv mov mpeg)
+ accept %w(wmv avi mp4 mkv mov mpeg flv)
# Define the minimum and maximum allowed file sizes (in bytes)
limit min: 5*1000*1000, max: 2*1000*1000*1000
@@ -442,7 +442,9 @@ function UploadPart(blob, key, upload) {
upload.handler.onError(upload, part);
};
xhr.upload.onprogress = _.throttle(function(e) {
- upload.inprogress[key] = e.loaded;
+ if (upload.inprogress[key] != 0) {
+ upload.inprogress[key] = e.loaded;
+ }
}, 1000);
};
@@ -456,6 +458,7 @@ UploadPart.prototype.pause = function() {
this.xhr.abort();
this.status = "paused";
};
+
return S3MP;
}());
Oops, something went wrong.

0 comments on commit 9f67e6e

Please sign in to comment.