Matthias Mullie has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/362195 )

Change subject: Fix chunked upload failure handling
......................................................................

Fix chunked upload failure handling

When the upload fails (for the last time, without a retry), it
would only execute a rejection of a deferred that is unused.
Since nothing else is returned there, it would turn the rejection
into a resolve.
Instead, we just shouldn't act upon this rejection and keep it
as rejected...

Change-Id: If36388fc0fa89d8d96293d659f1f38e077db65a5
---
M resources/src/mediawiki/api/upload.js
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/95/362195/1

diff --git a/resources/src/mediawiki/api/upload.js 
b/resources/src/mediawiki/api/upload.js
index 40a4528..6af15de 100644
--- a/resources/src/mediawiki/api/upload.js
+++ b/resources/src/mediawiki/api/upload.js
@@ -393,8 +393,7 @@
                uploadChunk: function ( file, data, start, end, filekey, 
retries ) {
                        var upload, retry,
                                api = this,
-                               chunk = this.slice( file, start, end ),
-                               deferred = $.Deferred();
+                               chunk = this.slice( file, start, end );
 
                        // When uploading in chunks, we're going to be issuing 
a lot more
                        // requests and there's always a chance of 1 getting 
dropped.
@@ -432,7 +431,7 @@
                        return upload.then(
                                        null,
                                        // If the call fails, we may want to 
try again...
-                                       retries === 0 ? deferred.reject : retry,
+                                       retries === 0 ? null : retry,
                                        function ( fraction ) {
                                                // Since we're only uploading 
small parts of a file, we
                                                // need to adjust the reported 
progress to reflect where

-- 
To view, visit https://gerrit.wikimedia.org/r/362195
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If36388fc0fa89d8d96293d659f1f38e077db65a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to