-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Resume/Pause functionality breaks with S3 when adding a prefix to the key #5429
Comments
Don't download it! This is a computer virus. |
@mshoaib112215 can you share the versions of the Uppy packages you're using please? |
The code you shared can't really be run as is (e.g. there's an undeclared variable async listParts(file, { key, uploadId, signal }) {
if (signal?.aborted) {
const err = new DOMException("The operation was aborted", "AbortError");
Object.defineProperty(err, "cause", {
configurable: true,
writable: true,
value: signal.reason,
});
throw err;
}
return uploadedPartsList[key];
} I think the problem is that you're not communicating with your backend for listing parts, instead the client makes assumption about which parts have been uploaded, which are (at least sometimes) wrong, causing incomplete uploads. For reference, here's our internal implementation: uppy/packages/@uppy/aws-s3/src/index.ts Lines 497 to 512 in bb4bbaa
uppy/packages/@uppy/companion/src/server/controllers/s3.js Lines 142 to 189 in bb4bbaa
|
Initial checklist
Link to runnable example
No response
Steps to reproduce
Description: When I add a prefix to the key to get the pre-signed URL for multipart upload, the file uploads successfully if I don't pause and resume the upload. However, if I pause and then resume the upload, I encounter the following error:
If I remove the prefix from the key, the upload works fine even when paused and resumed. However, I need to add a prefix to the key for my use case.
Backend:
Initialize S3 Client: Set up the S3 client and define the S3 bucket and object key prefix.
Sign URL for Upload: Generate a signed URL for direct file upload to S3.
Handle Multipart Upload:
Frontend:
Backend Code:
Frontend Code:
If you need further details or assistance, please let me know!
Expected behavior
The file upload should resume and complete successfully without any errors, even when a prefix is added to the key.
Actual behavior
When the upload is resumed after pausing with a prefix added to the key, the above error occurs. Without the prefix, the upload resumes successfully.
The text was updated successfully, but these errors were encountered: