Closed michaeljauk closed 3 months ago
Hi @michaeljauk this is interesting, I can't reproduce the issue. Can you provide more information on how you are sending the DeleteObjects Command?
In the PR above I've added more strict validation. But apparently, the command you are sending doesn't seem to be conforming with the Spec.
Once you have more information on this, I'll be happy to dig further
@fenos I dug a bit deeper and verified that an HTTP 500
error only gets thrown when trying to delete a single file via the DeleteObjectsCommand. When trying to delete multiple files it works flawlessly. Sorry for not catching that earlier!
This is something that i verified works with native S3, as well as MinIO though. So i guess, this is still something you'd want to fix or rather change? 🤔
For further reference, I'm using Typescript/Node.js and the @aws-sdk/client-s3
lib.
See this example, which works with S3/MinIO but not Supabase:
const params: DeleteObjectsCommandInput = {
Bucket: "testBucket",
Delete: {
Objects: [{ Key: "singleFile" }],
},
};
const command = new DeleteObjectsCommand(params);
await this.client.send(command);
@michaeljauk thanks a lot for this! I could reproduce the issue, filing a fix shortly!
Ok, I have expanded the above PR and introduced the fix. TLDR, the XML parser when it receives only an item, parses it as an object as opposed to an array.
I could force the parsing to an array by implementing the isArray
method on the fast-xml-parser
:tada: This issue has been resolved in version 1.5.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
@fenos Thanks for resolving this so quickly! I guess another week or 2 weeks until it is GA? 👀
it is now being deployed GA
Bug report
Describe the bug
When trying to delete a single file via the S3 API (calling
POST /s3/<bucket>/?delete=&x-id=DeleteObjects
, DeleteObjects Command) aHTTP 500
error gets returned and no file gets deleted. In the corresponding logs of Supbase the following error gets displayed (abbreviated for brevity):To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
DeleteObjectsCommand
Expected behavior
The corresponding files should be deleted