Skip to content
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

@uppy/transloadit: fix check if all files have been removed #5419

Merged
merged 3 commits into from
Aug 20, 2024

Conversation

Murderlon
Copy link
Member

When you use Uppy and allow uploads to start without any files added, which means you want Transloadit to import files, @uppy/transloadit currently always sends a DELETE request immediately after starting the assembly.

This is a regression from #5202

@Murderlon Murderlon requested review from mifi and aduh95 August 20, 2024 08:16
@Murderlon Murderlon self-assigned this Aug 20, 2024
Copy link
Contributor

github-actions bot commented Aug 20, 2024

Diff output files
diff --git a/packages/@uppy/transloadit/lib/index.js b/packages/@uppy/transloadit/lib/index.js
index d52478f..3ecb5db 100644
--- a/packages/@uppy/transloadit/lib/index.js
+++ b/packages/@uppy/transloadit/lib/index.js
@@ -519,7 +519,7 @@ async function _createAssembly2(fileIDs, assemblyOptions) {
       } = _ref;
       return fileIDs.includes(id);
     });
-    if (files.length === 0) {
+    if (files.length === 0 && fileIDs.length !== 0) {
       await this.client.cancelAssembly(newAssembly);
       return null;
     }

Co-authored-by: Antoine du Hamel <[email protected]>
@Murderlon Murderlon merged commit a50c18f into main Aug 20, 2024
17 checks passed
@Murderlon Murderlon deleted the transloadit-cancel-assembly branch August 20, 2024 08:58
Murderlon added a commit that referenced this pull request Aug 21, 2024
github-actions bot added a commit that referenced this pull request Aug 21, 2024
| Package           | Version | Package           | Version |
| ----------------- | ------- | ----------------- | ------- |
| @uppy/core        |   4.1.2 | @uppy/transloadit |   4.1.0 |
| @uppy/status-bar  |   4.0.3 | uppy              |   4.2.0 |
| @uppy/svelte      |   4.0.1 |                   |         |

- @uppy/status-bar: show upload button when files are recovered (Merlijn Vos / #5418)
- meta: Bump docker/build-push-action from 6.6.1 to 6.7.0 (dependabot[bot] / #5413)
- docs: remove stale reference to plugins page (Merlijn Vos / #5414)
- @uppy/transloadit: add execution_progress to AssemblyResponse type (Merlijn Vos / #5420)
- @uppy/svelte: fix exports condition (Merlijn Vos / #5416)
- @uppy/transloadit: fix check if all files have been removed (Merlijn Vos / #5419)
- examples: remove `useUppy` from React Native example (Mikael Finstad / #5405)
github-actions bot added a commit that referenced this pull request Aug 21, 2024
| Package           | Version | Package           | Version |
| ----------------- | ------- | ----------------- | ------- |
| @uppy/transloadit |   3.8.1 | uppy              |  3.27.4 |

- @uppy/transloadit: fix check if all files have been removed (Merlijn Vos / #5419)
- meta: enable CI on `3.x` branch (Antoine du Hamel)
- meta: pin uppy.io repo to the commit before Uppy 4.0.0 (Antoine du Hamel)
- meta: prepare release workflow for 3.x versions (Antoine du Hamel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants