Perform chunked uploads from upload dialog
authorMatthias Mullie <git@mullie.eu>
Wed, 28 Jun 2017 15:24:42 +0000 (17:24 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 5 Jul 2017 21:02:20 +0000 (21:02 +0000)
These should be a little more resilient to network issues.
There is no longer 1 huge chunk that can fail, it'll now
be a bunch of more discreet chunks, and it'll retry once
(by default) if a chunk fails.

Bug: T132611
Change-Id: Ib9cc2c77a27658accf728fb37f8cebc879a467d2

resources/src/mediawiki/mediawiki.Upload.js

index 02df2a8..7e6cfb6 100644 (file)
 
                this.setState( Upload.State.UPLOADING );
 
-               return this.api.upload( this.getFile(), {
+               return this.api.chunkedUpload( this.getFile(), {
                        watchlist: ( this.getWatchlist() ) ? 1 : undefined,
                        comment: this.getComment(),
                        filename: this.getFilename(),
 
                this.setState( Upload.State.UPLOADING );
 
-               this.stashPromise = this.api.uploadToStash( this.getFile(), {
+               this.stashPromise = this.api.chunkedUploadToStash( this.getFile(), {
                        filename: this.getFilename()
                } ).then( function ( finishStash ) {
                        upload.setState( Upload.State.STASHED );