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

Requesting file previews should be limited in concurrency #1387

Closed
SystemKeeper opened this issue Jul 9, 2024 · 0 comments · Fixed by #1478
Closed

Requesting file previews should be limited in concurrency #1387

SystemKeeper opened this issue Jul 9, 2024 · 0 comments · Fixed by #1478
Labels
bug Something isn't working file picker

Comments

@SystemKeeper
Copy link

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

watchEffect(() => {
canLoadPreview.value = false
if (previewURL.value) {
const loader = new Image()
loader.src = previewURL.value.href
loader.onerror = () => loader.remove()
loader.onload = () => { canLoadPreview.value = true; loader.remove() }
}
})

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"?!

@nickvergessen nickvergessen added the bug Something isn't working label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working file picker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants