From ca916f6580bbcf672f1249fe05d5a5047bee3451 Mon Sep 17 00:00:00 2001 From: Prakash Date: Wed, 20 May 2026 10:33:47 +0530 Subject: [PATCH] @uppy/transloadit: fix stale assemblyStatus in 'transloadit:assembly-cancelled' event (#6294) @mifi this is small change which we missed , based on our discussion in uppy call. --------- Co-authored-by: Mikael Finstad --- .changeset/proud-spies-train.md | 5 +++++ packages/@uppy/transloadit/src/index.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/proud-spies-train.md diff --git a/.changeset/proud-spies-train.md b/.changeset/proud-spies-train.md new file mode 100644 index 000000000..10d332013 --- /dev/null +++ b/.changeset/proud-spies-train.md @@ -0,0 +1,5 @@ +--- +"@uppy/transloadit": patch +--- + +emit updated AssemblyState in 'transloadit:assembly-cancelled' event diff --git a/packages/@uppy/transloadit/src/index.ts b/packages/@uppy/transloadit/src/index.ts index c54150cdd..326981b6c 100644 --- a/packages/@uppy/transloadit/src/index.ts +++ b/packages/@uppy/transloadit/src/index.ts @@ -658,7 +658,10 @@ export default class Transloadit< async #cancelAssembly(assembly: AssemblyResponse) { await this.client.cancelAssembly(assembly) // TODO bubble this through AssemblyWatcher so its event handlers can clean up correctly - this.uppy.emit('transloadit:assembly-cancelled', assembly) + + // if assemblyStatus has been updated after the cancellation was triggered, emit the updated assemblyStatus - fallback to the method argument + const updatedAssemblyStatus = this.assembly?.status ?? assembly + this.uppy.emit('transloadit:assembly-cancelled', updatedAssemblyStatus) this.assembly = undefined }