You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2026. It is now read-only.
Is your feature request related to a problem? Please describe.
I frequently find myself performing delete operations on files that may or may not exist. Similar to how Cloud Firestore's delete operation works, I would like for the Cloud Storage delete operation to consider a non-existent file as a successful deletion. In other words, I want my delete operation to be considered successful if the file does not exist after the operation completes- regardless of if it did exist before the operation.
Describe the solution you'd like
The delete operation (docs here) takes an optional options object, whose only parameter is currently userProject. I would like a new property to be available that I could use to enable this mechanism on a per-operation basis. The syntax might look something like:
Describe alternatives you've considered
The two alternatives are to either 1) run a File.exists operation first, or 2) handle deletion error in catch block. Both alternatives work, they're just not very elegant. Alternative 1 technically also leaves an unlikely but possible scenario where the file is removed after the the exists operation but before the delete operation.
Is your feature request related to a problem? Please describe.
I frequently find myself performing
deleteoperations on files that may or may not exist. Similar to how Cloud Firestore'sdeleteoperation works, I would like for the Cloud Storagedeleteoperation to consider a non-existent file as a successful deletion. In other words, I want mydeleteoperation to be considered successful if the file does not exist after the operation completes- regardless of if it did exist before the operation.Describe the solution you'd like
The
deleteoperation (docs here) takes an optionaloptionsobject, whose only parameter is currentlyuserProject. I would like a new property to be available that I could use to enable this mechanism on a per-operation basis. The syntax might look something like:Describe alternatives you've considered
The two alternatives are to either 1) run a
File.existsoperation first, or 2) handle deletion error in catch block. Both alternatives work, they're just not very elegant. Alternative 1 technically also leaves an unlikely but possible scenario where the file is removed after the theexistsoperation but before thedeleteoperation.Additional context
None.