nextcloud-libraries / nextcloud-dialogs

Nextcloud dialog helpers https://npmjs.org/@nextcloud/dialogs
https://nextcloud-libraries.github.io/nextcloud-dialogs/
GNU Affero General Public License v3.0
19 stars 9 forks source link

Requesting file previews should be limited in concurrency #1387

Open SystemKeeper opened 3 months ago

SystemKeeper commented 3 months ago

Currently we request all previews for the files in a folder at once

https://github.com/nextcloud-libraries/nextcloud-dialogs/blob/3e49a75698d930c39beeec12f31c84a172fe40e1/lib/components/FilePicker/FilePreview.vue#L38-L47

This will be problematic for folders with a large amount of files and/or previews that are not already cached. We should therefore limited the amount of requests we do in parallel as it is done on file deletion with a PQueue for example:

https://github.com/nextcloud/server/blob/025a7849b487351d0240d89833b3ab825897097d/apps/files/src/actions/deleteAction.ts#L106

Alternatively the previews should only be requested if they are close to "getting into the visible view"?!