Genbox / SimpleS3

A .NET Core implementation of Amazon's S3 API with focus on simplicity, security and performance
MIT License
44 stars 8 forks source link

Possible bug in DeleteAllObjectsAsync(): yield-break before yield-return #48

Closed LordMike closed 2 years ago

LordMike commented 2 years ago

In the code below, if the delete response has an error, it will yield-break before it enumerates the errors and yield-returns those.

So for a consumer, it will look like the enumeration completes.

Note: I assume that IsSuccess is false when Errors is non-empty.. If it wasn't, then the break wouldn't make sense as an early exit.

https://github.com/Genbox/SimpleS3/blob/b6ee0785715b6427a51ee61256a96437eb18b39a/src/SimpleS3.Core/Extensions/ObjectClientExtensions.cs#L88-L94

LordMike commented 2 years ago

The code also breaks if the list response doesn't succeed.

https://github.com/Genbox/SimpleS3/blob/b6ee0785715b6427a51ee61256a96437eb18b39a/src/SimpleS3.Core/Extensions/ObjectClientExtensions.cs#L64-L67