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

Multiple file upload race condition sorting #15308

Closed
angus-mcritchie opened this issue Jan 9, 2025 · 1 comment
Closed

Multiple file upload race condition sorting #15308

angus-mcritchie opened this issue Jan 9, 2025 · 1 comment
Labels

Comments

@angus-mcritchie
Copy link

Package

filament/filament

Package Version

v3.2.132

Laravel Version

v11.37.0

Livewire Version

v3.5.12

PHP Version

8.3.15

Problem description

Upload 2 or more files, the sorting is based on which one uploads first rather than the visible sort order of the uploader.

This happens because FilePond core options default value of maxParallelUploads is 2.

filament-race-sorting.mp4

A simple work around would be allowing to change the maxParallelUploads to 1 and everything would work.

But ideally, we should allow maxParallelUploads to change to more than 1 and still resoect the upload order regardless which file uploads first.

Expected behavior

Select files to upload, order will show 1.svg first, then 2.svg and after upload for them to remain in the same order regardless which one is uploaded first.

Steps to reproduce

clone the reproduction repository
run php artisan migrate
run php artisan db:seed
Login and go to the http://localhost/admin/users/1/edit
Upload 2 or more files (with different file sizes helps reproduce more easily) and see the order change based on which on is uploaded first

Reproduction repository (issue will be closed if this is not valid)

https://github.com/angus-mcritchie/filament-image-race-sorting

Relevant log output

No response

@danharrin
Copy link
Member

Thanks for the PR, another setting you can try that affects ordering is appendFiles()

@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants