Merge "Don't allow completing a partial stash upload"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 15 May 2019 18:02:59 +0000 (18:02 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 15 May 2019 18:02:59 +0000 (18:02 +0000)
resources/src/mediawiki.api/upload.js

index 619dd7c..fe21f07 100644 (file)
                                        return finishUpload;
                                },
                                function ( errorCode, result ) {
-                                       if ( result && result.upload && result.upload.filekey ) {
-                                               // Ignore any warnings if 'filekey' was returned, that's all we care about
+                                       if ( result && result.upload && result.upload.result === 'Success' && result.upload.filekey ) {
+                                               // Catch handler is also called in case of warnings (e.g. 'duplicate')
+                                               // We don't really care about those warnings, as long as the upload got stashed...
                                                filekey = result.upload.filekey;
                                                return $.Deferred().resolve( finishUpload );
                                        }