opendal icon indicating copy to clipboard operation
opendal copied to clipboard

bug: multiple file with same name in google drive crash

Open qkzk opened this issue 1 year ago • 3 comments

Describe the bug

While debugging and trying to list a google drive, if multiple files have the same name exactly, the application crash. For some reason, GoogleDrive allows multiple files to have exactly the same name.

This is handled here and this check is disabled in release mode.

Steps to Reproduce

Connect to a google drive with two files having exactly the same name and do a op.list(...)

Expected Behavior

I guess the simplest is to completely ignore the file and not crash or simply log an error somewhere.

At least, the error and comment should be more precise.

Additional Context

I'm new to the library, sorry if it's the expected behavior or if there's another issue about it. I couldn't find anything about that.

Are you willing to submit a PR to fix this bug?

  • [ ] Yes, I would like to submit a PR.

qkzk avatar Sep 05 '24 11:09 qkzk

I used to think we should prohibit this case, but I've somewhat changed my mind. I now believe that we can simply permit such cases and only select the newest one while read and returning all of them during the list.

Anyway, we can ignore the file at first. Would you like to help implement it?

Xuanwo avatar Sep 05 '24 11:09 Xuanwo

I'll take a look !

qkzk avatar Sep 05 '24 12:09 qkzk

Something as simple as that ?

qkzk avatar Sep 05 '24 12:09 qkzk

@qkzk Did #5226 fix your issue?

https://github.com/apache/opendal/blob/main/core/src/services/gdrive/lister.rs#L97-L102

erickguan avatar Dec 01 '24 09:12 erickguan