Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@uppy/transloadit

Package Overview
Dependencies
Maintainers
6
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uppy/transloadit - npm Package Compare versions

Comparing version 3.1.4 to 3.1.5

7

CHANGELOG.md
# @uppy/transloadit
## 3.1.5
Released: 2023-05-15
Included in: Uppy v3.9.1
- @uppy/transloadit: clean up event listener to prevent cancelled assemblies (Merlijn Vos / #4447)
## 3.1.4

@@ -4,0 +11,0 @@

19

lib/index.js

@@ -18,3 +18,3 @@ function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }

const packageJson = {
"version": "3.1.4"
"version": "3.1.5"
};

@@ -749,8 +749,19 @@

}
});
}); // TODO: this should not live inside a `file-removed` event but somewhere more deterministic.
// Such as inside the function where the assembly has succeeded or cancelled.
// For the use case of cancelling the assembly when needed, we should try to do that with just `cancel-all`.
const fileRemovedHandler = (fileRemoved, reason) => {
var _assembly$status;
// If the assembly has successfully completed, we do not need these checks.
// Otherwise we may cancel an assembly after it already succeeded
if (((_assembly$status = assembly.status) == null ? void 0 : _assembly$status.ok) === 'ASSEMBLY_COMPLETED') {
this.uppy.off('file-removed', fileRemovedHandler);
return;
}
if (reason === 'cancel-all') {
assembly.close();
this.uppy.off(fileRemovedHandler);
this.uppy.off('file-removed', fileRemovedHandler);
} else if (fileRemoved.id in updatedFiles) {

@@ -767,3 +778,3 @@ delete updatedFiles[fileRemoved.id];

this.uppy.off(fileRemovedHandler);
this.uppy.off('file-removed', fileRemovedHandler);
} else {

@@ -770,0 +781,0 @@ this.client.updateNumberOfFilesInAssembly(newAssembly, nbOfRemainingFiles).catch(() => {

{
"name": "@uppy/transloadit",
"description": "The Transloadit plugin can be used to upload files to Transloadit for all kinds of processing, such as transcoding video, resizing images, zipping/unzipping, and more",
"version": "3.1.4",
"version": "3.1.5",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

@@ -244,6 +244,15 @@ import hasProperty from '@uppy/utils/lib/hasProperty'

// TODO: this should not live inside a `file-removed` event but somewhere more deterministic.
// Such as inside the function where the assembly has succeeded or cancelled.
// For the use case of cancelling the assembly when needed, we should try to do that with just `cancel-all`.
const fileRemovedHandler = (fileRemoved, reason) => {
// If the assembly has successfully completed, we do not need these checks.
// Otherwise we may cancel an assembly after it already succeeded
if (assembly.status?.ok === 'ASSEMBLY_COMPLETED') {
this.uppy.off('file-removed', fileRemovedHandler)
return
}
if (reason === 'cancel-all') {
assembly.close()
this.uppy.off(fileRemovedHandler)
this.uppy.off('file-removed', fileRemovedHandler)
} else if (fileRemoved.id in updatedFiles) {

@@ -255,3 +264,3 @@ delete updatedFiles[fileRemoved.id]

this.#cancelAssembly(newAssembly).catch(() => { /* ignore potential errors */ })
this.uppy.off(fileRemovedHandler)
this.uppy.off('file-removed', fileRemovedHandler)
} else {

@@ -258,0 +267,0 @@ this.client.updateNumberOfFilesInAssembly(newAssembly, nbOfRemainingFiles)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc