Skip to content
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

Inconsistent file path handling across storage providers #89

Open
dtila opened this issue Oct 7, 2024 · 0 comments
Open

Inconsistent file path handling across storage providers #89

dtila opened this issue Oct 7, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed major

Comments

@dtila
Copy link

dtila commented Oct 7, 2024

First-time user, I gave a try to use the library for the app I am building. I am opening an issue to share my experience, code and I will make some suggestions.

I have used the library for native disk usage and with MinIO configuration, and the only operations were to ListAllFiles() and WriteAsync()

  1. First issue was when blob was configured to disk, the following code was throwing DirectoryNotFoundException
    return await _blobStorage.ListFilesAsync(new ListOptions { FilePrefix = path }, cancellationToken);
    the path variable had the value 100205175_3/. I fixed the issue by wrapping in a trycatch and returned an empty collection, like it was expected (despite that was provider specific exception).
    WriteAsync was called with filePaths like 100205175_3/00008_temp.pdf

  2. After had the code running perfectly with disk, I have configured to use MinIO. The write was successful since I could see the files in the bucket -> 100205175_3 (this was the folder name), all the files were there. I tried various inputs like 100205175_3/* , 100205175_3*, 100205175_3 or /100205175_3 but in every case an empty list was returned

I got the code and referenced it directly in my project to try to see if there is a quick issue, and I saw a lot of if's related to prefix and file paths. I haven't check other provider except Amazon, but I assume it's the same.

The challenge I see with this library is having uniform file paths and folder structure and this could be easily fixed by applying Domain Driven Design. That would require a full refactoring from the library but will fix all those issues and work like a charm.

I have a YouTube video where I am explaining how to build this: https://www.youtube.com/watch?v=6XfQxy0Js6I (ignore the persistence part). Since my YouTube is focused on content around DDD and how you apply in real-life projects, I may do a video with some refactoring to the project. However, this has to be agreed upon with the project maintainers as well.

Bottom line, due to the fact I was unable to find the issue, I have removed the library from my project and used the native MinIO library.

@robinrodricks robinrodricks changed the title Inconsistent design Inconsistent file path handling across storage providers Oct 7, 2024
@robinrodricks robinrodricks added enhancement New feature or request help wanted Extra attention is needed major labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed major
Projects
None yet
Development

No branches or pull requests

3 participants
@dtila @robinrodricks and others