appwrite/sdk-generator

๐Ÿ› Bug Report: Server sdk for node deleteFile api delete storage bucket instead of file.

usamashafiqs opened this issue ยท 2 comments

๐Ÿ‘Ÿ Reproduction steps

Server sdk for node deleteFile api delete storage bucket if file ID had empty string as parameter.
It should throw exception if file ID had empty string.

try {
    const res = await SDK.storage.deleteFile('BucketID', '');
    console.log(res);
} catch (e) {
    if (e instanceof AppwriteException) {
        console.log(e.message);
    }
    console.log(e);
}

๐Ÿ‘ Expected behavior

It should throw exception if file ID had empty string provided instead of file ID.

๐Ÿ‘Ž Actual Behavior

Server sdk for node deleteFile api delete storage bucket if file ID had empty string as parameter.

๐ŸŽฒ Appwrite version

Different version (specify in environment)

๐Ÿ’ป Operating system

Linux

๐Ÿงฑ Your Environment

Appwrite version 1.2.1
node-appwrite version 8.2.0

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

Hi ๐Ÿ‘‹๐Ÿป Thanks for reporting, I'll discuss with the team to come up with a solution. I'll keep you posted

Closing as this has been addressed in Appwrite so that the API call doesn't get matched to the bucket endpoint.