Hi,
I’m not sure if this is a usage problem or perhaps a bug in uppy or one of the plugins.
I’m using Uppy with Transloadit and programmatically uploading two files to a single assembly. Everything works except Uppy mistakenly thinks the uploads are failing when they are actually succeeding.
The error message appears to come from the Tus plugin and it seems to be due to the assembly being further along than expected.
This error appears in the console:
tus: unexpected response while creating upload, originated from request (method: POST, url: https://api2-ferraz.transloadit.com/resumable/files/, response code: 400, response text: {\"error\":\"Assembly 5310b6f516da4cf4902eb8428d6a2b7a is not in ASSEMBLY_UPLOADING state (instead ASSEMBLY_EXECUTING)\"})\n, request id: 28cd124f-5bfa-4b9a-af4d-17d748b79199
And the uppy complete
event always fires with both files in failed
and none in successful
, but both files do upload and the assembly completes successfully.
Here is a small example to reproduce:
// "@uppy/core": "^1.12.2",
// "@uppy/react": "^1.10.2",
// "@uppy/transloadit": "^1.6.5",
// "@uppy/tus": "^1.7.3",
const id = 'image'; // there is another uploader on the page with id video
const uppy = new Uppy({id, debug: true});
const params = {/*transloadit params*/};
const fields = [/*meta field names*/];
uppy.use(Transloadit, {
params,
fields,
waitForEncoding: false, // tried with true to no avail
waitForMetadata: false, // tried with true to no avail
});
uppy.addFile(watermarkFile);
uppy.addFile(imageFile);
const meta = {/*metadata*/};
uppy.setMeta({
...meta,
watermark: watermarkFile,
image: imageFile
});
uppy.once('transloadit:assembly-created', (assembly) => {
// this works
console.log(assembly);
});
uppy.once('complete', ({successful, failed}) => {
// this always has both files in "failed" despite them uploading successfully and the assembly completing successfully
console.log(successful, failed);
if (failed.length) {
alert('failed');
}
});
uppy.upload();
Any ideas appreciated!