-
Notifications
You must be signed in to change notification settings - Fork 282
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: removeObject
#1161
refactor: removeObject
#1161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I too have evaluated alternatives and the suggestion. yes. We can go ahead with this for the flexibility it offers. 👍 @trim21 |
This make thing much easier |
@prakashsvmx i mark callback style api as deprecated, hope this is not a problem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested.
- forceDelete
- versionId
- governanceBypass w/o versionId
Changes look good to me.
Co-authored-by: Kaan Kabalak <[email protected]>
Co-authored-by: Kaan Kabalak <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR refactors
Client.removeObject
to TypeScript.What's maintainers' option on this, is this an acceptable change?
ideally, refactered method should use
async
function and we can wrapped them withcallbackify
to handle potential latest callback function argument.this also make it easier to add arguments, no need to do this:
But currently, arguments are checked synchronously.
for example: callback can't catch the error throwed by method.
they need to catch null bucket name error like this:
after this PR,
client.removeObject(null, '...', (err,result)=>{})
will not throw, but always return error to callback or promise reject.also, mark callback style API as
@deprecated