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

Fix issue with file uploader dropping every other file #6912

Merged

Conversation

vdonato
Copy link
Collaborator

@vdonato vdonato commented Jun 27, 2023

There's currently a bug in the file uploader feature branch where uploading a second
file to a file uploader accepting a single file (without clearing the first one) doesn't work
correctly.

The root cause of this issue is that the original file is removed from the FileUploader react
component's state before we've fetched new file URLs and started the file upload process.
This causes react to call the component's componentDidUpdate method too early, which
triggers a script rerun with an empty file uploader state.

The fix is to defer any state mutations until after we've fetched fileUrls + started uploading files.

@vdonato vdonato force-pushed the vdonato/file_uploader_bugfix branch from 72eb7b0 to 103808f Compare June 28, 2023 18:18
@vdonato vdonato merged commit 65f33c1 into feature/file_uploader_abstractions Jun 28, 2023
34 of 39 checks passed
@vdonato vdonato deleted the vdonato/file_uploader_bugfix branch June 28, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants