Skip to content

Conversation

@shwetas16
Copy link

Signed-off-by: Shweta Melton <shweta@shweta_s@hotmail.com>

  • Added delete blobs API that would delete the blob file and the blob metadata file
  • If any of the files for the blob do not exist, it will clean up whatever exists.
  • On success, returns Blob metadata if available or empty response (if the metadata file did not exist at the time of deletion)
  • Added unit tests
  • Updated Swagger documentation

Signed-off-by: Shweta Melton <shweta@shweta_s@hotmail.com>
@gabriel-indik
Copy link
Contributor

This is a great contribution, it's awesome to see this functionality being added. There are two items in the PR that might be worth looking at in more detail:

  1. In line 148 of src/handlers/blobs.ts fs.readFile is used, which reads the entire file into memory. I can see that the intention was to provide a fallback where the file is restored in case an exception happens. However the issue with this approach is that the file could be arbitrarily large which could cause problems when attempting to load it into memory.

  2. Response when the file has already been deleted should perhaps be 404 instead of 200. Note that this wouldn't interfere with idempotent behavior. Basically the API would be responding with not found when the URL of a resource that no longer exists is used for deletion.

@nguyer
Copy link
Contributor

nguyer commented Sep 19, 2022

@shwetas16 Thanks for contributing this! It looks like your email address is malformed in the sign-off message which is why the DCO check failed.

Commit sha: [4a3d605](https://github.com/hyperledger/firefly-dataexchange-https/pull/71/commits/4a3d6057048d76ee63b00b1f123e7f87803de68a), Author: Shweta Melton, Committer: Shweta Melton; Expected "Shweta Melton [shweta_s@hotmail.com](mailto:shweta_s@hotmail.com)", but got "Shweta Melton <shweta@[shweta_s@hotmail.com](mailto:shweta_s@hotmail.com)>".

You will need to amend that commit and force push to your branch again to resolve that. Thanks!

@gabriel-indik
Copy link
Contributor

Deletion functionality added in #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants