spatie / flysystem-dropbox

A flysystem driver for Dropbox that uses the v2 API
https://freek.dev/734-dropbox-will-turn-off-v1-of-their-api-soon-its-time-to-update-your-php-application
MIT License
342 stars 50 forks source link

listContents on subfolder of camelcase folder returns nothing #9

Closed Alex-D closed 7 years ago

Alex-D commented 7 years ago

HI!

This bug seems similar to: https://github.com/thephpleague/flysystem-dropbox/issues/3

Dropbox API v1 and v2 are both case-insensitive: https://www.dropboxforum.com/t5/API-support/Case-Sensitivity-in-API-2/m-p/191279#M8337

If I try to fetch "Test1/Test2/toto.txt" that returns nothing, because Dropbox returns "test1/Test2/toto.txt" and does not match.

Can we do somthing for that?

Thanks! :)

Alex-D commented 7 years ago

The result is empty because I use the Filesystem wrapper which add checks: https://flysystem.thephpleague.com/performance/

As the Dropbox path is not the same as the real path, the Filesystem check fails, then no files are returned.

Alex-D commented 7 years ago

There is the check: https://github.com/thephpleague/flysystem/blob/master/src/Util/ContentListingFormatter.php#L98

So, to use the Filesystem wrapper, we should have the correct paths.

Alex-D commented 7 years ago

I can't wrap the Dropbox adapter into the CacheAdapter.

The first fetch returns the correct result, but all other hits has the same bug: empty result. The cache is "correctly" writen based on Dropbox result: parent folders are in lowercase which breaks the CacheAdapter logic.

freekmurze commented 7 years ago

I guess this issue more belongs on dropbox-api. Not sure what a good solutions might be...