minio/minio-dotnet

Behavior of StatObject changed in 6.0.1

coronabytes opened this issue · 1 comments

Hi,

we used the following code to check if an object exists in minio.
Up till 6.0.0 this was working as expected

    public async Task<bool> ExistsAsync(string bucket, string path)
    {
        try
        {
            var stat = await _client.StatObjectAsync(new StatObjectArgs().WithBucket($"{_realm}-{bucket}").WithObject(path)).ConfigureAwait(false);

            return true;
        }
        catch (ObjectNotFoundException)
        {
            return false;
        }
    }

no exception is thrown in 6.0.1
any suggestion what props to test for nonexistence?

size == 0 maybe?

@coronabytes

This issue has been fixed in PR #987.
The fix will be available in the next release which is coming soon.
You can check if the fix works for you using the latest MinIO dotnet code from the top of the master.
Please reopen this issue if the fix does not work in your scenario.