FluentStorage icon indicating copy to clipboard operation
FluentStorage copied to clipboard

GCP Storage provider DeleteAsync will delete all files in bucket if target full path object is not found

Open geoffreytran opened this issue 1 year ago • 2 comments

When a call to DeleteAsync() is provided with an invalid path, it will fall back to recursively deleting from the root of the bucket.

There appears to be an rm -rf /* type of issue with the way the recursive folder deletion is handled. It looks like this List call was supposed to be a ListAt call rather than listing the contents of the bucket.

https://github.com/robinrodricks/FluentStorage/blob/9cf945ed0ea3feaafacdb7d3dc5afb91eb7e2f12/FluentStorage.GCP/Blobs/GoogleCloudStorageBlobStorage.cs#L119

geoffreytran avatar Feb 02 '24 23:02 geoffreytran

If you can fix this and submit a PR, I would gladly accept it.

robinrodricks avatar Feb 03 '24 06:02 robinrodricks

Sure thing, I'll submit later this week!

geoffreytran avatar Feb 05 '24 21:02 geoffreytran

Closing this as fixed.

robinrodricks avatar Aug 17 '24 05:08 robinrodricks