Skip to content

Reset stalled state in upload data after retrying #32283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ OC.Uploader.prototype = _.extend({
if (progress >= total) {
// change message if we stalled at 100%
this.$uploadprogressbar.find('.label .desktop').text(t('core', 'Processing files...'));
} else if (new Date().getTime() - this._lastProgressTime >= this._uploadStallTimeout * 1000 ) {
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ... yes also makes sense

if (new Date().getTime() - this._lastProgressTime >= this._uploadStallTimeout * 1000 ) {
// TODO: move to "fileuploadprogress" event instead and use data.uploadedBytes
// stalling needs to be checked here because the file upload no longer triggers events
// restart upload
Expand Down Expand Up @@ -1124,6 +1125,7 @@ OC.Uploader.prototype = _.extend({
});

// clear the previous data:
upload.data.stalled = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, this makes sense

data.data = null;
// overwrite chunk
delete data.headers['If-None-Match'];
Expand Down
1 change: 1 addition & 0 deletions apps/files/tests/js/fileUploadSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ describe('OC.Upload tests', function() {
// uploaded bytes was set to the sum of all chunk sizes
expect(result[0].uploadedBytes).toEqual(300);
expect(result[0].data).toBeFalsy();
expect(upload.data.stalled).toEqual(false);

// header was cleared for overwriting
expect(result[0].headers['If-None-Match']).not.toBeDefined();
Expand Down