Skip to content
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

Refactor 'verify_object' to also delete the object in question when an exception is thrown #76

Closed
doulikecookiedough opened this issue Dec 20, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@doulikecookiedough
Copy link
Contributor

Currently, verify_object has been implemented without a return value and solely throws an exception if the checked values don't match what's found in the the object metadata. Given its expected use to be only after storing an object with just a stream, it seems intuitive to also delete the object when a mismatch occurs.

This simplifies the clean-up process for the calling client, since the only files that need to be removed at this point is the object itself (tag_object is not called since exceptions are thrown, so the reference files do not exist).

Alternatively, verify_object could also return a boolean, allowing the client to decide whether to delete the object or not. However, this means that delete_object needs to be refactored to handle this scenario.

@doulikecookiedough doulikecookiedough added the enhancement New feature or request label Dec 20, 2023
@doulikecookiedough doulikecookiedough self-assigned this Dec 20, 2023
@doulikecookiedough
Copy link
Contributor Author

This has been completed via Feature-76: Verify Object Refactor. For the time being, we are following the existing HashStore-java process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant