- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.6k
Properly abort uploads #30620
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
Properly abort uploads #30620
Conversation
| since now the deletion of the upload object is delayed, it messed up with the accounting that operates the progress bar I've pushed a fix to properly count the finished uploads so that the progress bar can be hidden, also in error cases. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
        
          
                apps/files/js/file-upload.js
              
                Outdated
          
        
      | abort: function() { | ||
| if (this.data.isChunked) { | ||
| this._deleteChunkFolder(); | ||
| var self = this; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self variable looks unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, leftover from previous fiddling. thanks for noticing
Add a new approach for flagging an upload as aborted because we can't rely on the browser fully cancelling the request as we now seem to receive an error response from the server instead of a jQuery "abort" message. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Whenever an error occurs, also hide the progress bar. The logic was also adjusted to properly detect uploads that are pending deletion, in which case the progress bar can already be hidden. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
d913f41    to
    11c7e10      
    Compare
  
    | I've fixed some bogus references to self and retested | 
| /backport to stable23 | 
| /backport to stable22 | 
| /backport to stable21 | 
| This is excellent news!! Thank you so much, @PVince81! | 
Add a new approach for flagging an upload as aborted because we can't
rely on the browser fully cancelling the request as we now seem to
receive an error response from the server instead of a jQuery "abort"
message.
Fixes: #14897
progress bar not removed!