fix: clean failed uploads when closing upload overlay#1300
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issue #524 by automatically cleaning up failed file uploads when the upload overlay is closed. The fix ensures that failed files are removed from the uppy service when no uploads are running and the user closes the overlay.
- Refactored UploadInfo component to use composition API for uppy service access
- Added safeguards to prevent negative item counts during upload progress tracking
- Implemented automatic cleanup of failed uploads when overlay is closed
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/web-runtime/src/components/UploadInfo.vue | Migrated from this.$uppyService to composition API pattern and added failed file cleanup logic |
| packages/web-pkg/src/services/uppy/uppyService.ts | Added removeFailedFiles() method to clean up failed uploads from uppy state |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| if (!file.meta.isFolder) { | ||
| if (!file.meta.relativeFolder) { | ||
| if (!file.meta.relativeFolder && this.itemsInProgressCount > 0) { |
There was a problem hiding this comment.
The condition this.itemsInProgressCount > 0 is added to prevent negative counts, but this could mask underlying issues where the count becomes inconsistent. Consider adding logging or debugging information to track when this condition prevents a decrement, which would help identify root causes of count mismatches.
There was a problem hiding this comment.
True, this is just a quick fix for an edge case scenario where a retry of a failed file would not be added to the count but subtracted eventually => counter can become <0. Solving this the properly would mean quite some refactoring, I'd rather not touch this now.
4ee54db to
8463c0c
Compare
fixes #524