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

Filelist module (files tree) not working due to recursive folders fetch #155

Open
soee opened this issue Oct 21, 2024 · 0 comments
Open

Comments

@soee
Copy link

soee commented Oct 21, 2024

Hi, I am not 100% sure if this case should be addressed directly in the extension, but probably yes.

We have the S3 storage with some folders and thousands of files moved from time to time between them.

Some time ago the folder tree stopped working - when the reload from the server action was triggered, we had only notification that something went wrong on the server side.

After some investigation on local environment it seems that issue is/was caused by the data returned from the S3 and how the https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Tree/FileStorageTreeProvider.php#L38 works.

So in our case the S3 driver was used for the dedicated storage (defined as separate storage in the TYPO3).
When TYPO3 sends request to ajax/filestorage/tree/fetchData to fetch the folders in the tree it iterates over storages and fetches the folders inside of them.
If the storage is browsable and marked as expanded in BE use settings, it will try to fetch subfolders recursively.
When the folders from the S3 bucket are returned, there is also a / prefix/folder returned which is later threated as root folder of storage and TYPO3 tries again to fetch all subfolders for it, and again S3 API returns a / prefix/folder and the loop continues.

For a temporary workaround I have added simple check

if ($folderCandidate['Prefix'] === '/') {
    continue;
}

in the https://github.com/andersundsehr/aus_driver_amazon_s3/blob/master/Classes/Driver/AmazonS3Driver.php#L937

I would like to know, what you think about this case, and what would be the best approach to avoid such issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant