@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 <finstaden@gmail.com>
This commit is contained in:
Prakash 2026-05-20 10:33:47 +05:30 committed by GitHub
parent 622daa498c
commit ca916f6580
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"@uppy/transloadit": patch
---
emit updated AssemblyState in 'transloadit:assembly-cancelled' event

View file

@ -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
}