Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Commit

Permalink
fix(uploader.basic.api.js): file marked as retrying too late
Browse files Browse the repository at this point in the history
Should happen before the wait period, not after.
fixes #1670
  • Loading branch information
rnicholus committed Nov 6, 2016
1 parent 5fb466b commit 9c0a312
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/js/uploader.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
}
}

if (newStatus === qq.status.UPLOAD_RETRYING) {
if (oldStatus === qq.status.UPLOAD_RETRYING && newStatus === qq.status.UPLOADING) {
this._templating.hideRetry(id);
this._templating.setStatusText(id);
qq(this._templating.getFileContainer(id)).removeClass(this._classes.retrying);
Expand Down
8 changes: 5 additions & 3 deletions client/js/uploader.basic.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1313,21 +1313,23 @@
self._preventRetries[id] = responseJSON[self._options.retry.preventRetryResponseProperty];

if (self._shouldAutoRetry(id, name, responseJSON)) {
var retryWaitPeriod = self._options.retry.autoAttemptDelay * 1000;

self._maybeParseAndSendUploadError.apply(self, arguments);
self._options.callbacks.onAutoRetry(id, name, self._autoRetries[id]);
self._onBeforeAutoRetry(id, name);

self._uploadData.setStatus(id, qq.status.UPLOAD_RETRYING);
self._retryTimeouts[id] = setTimeout(function() {
self.log("Retrying " + name + "...");
self._uploadData.setStatus(id, qq.status.UPLOAD_RETRYING);
self.log("Starting retry for " + name + "...");

if (callback) {
callback(id);
}
else {
self._handler.retry(id);
}
}, self._options.retry.autoAttemptDelay * 1000);
}, retryWaitPeriod);

return true;
}
Expand Down

0 comments on commit 9c0a312

Please sign in to comment.