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 FileManager reset during re-render of "make change" editing action #4866

Merged
merged 2 commits into from Apr 12, 2021

Conversation

ThiefMaster
Copy link
Member

The tags are not guaranteed to be sorted in a stable way, so sometimes the re-render caused by setLoading(true) resulted in the final-form's initialValues changing and thus reinitializing the form, triggering the file manager's logic to reset it as well and delete any pending files.

Since this happened in parallel with the submission of the reviewing action, it at least resulted in the deleting request failing, but often also in a race between the deletion request and it checking whether the file has been claimed and the review claiming it, which resulted in the file being deleted from storage but not the database.

This can happen if there's a race condition between something claiming
the file (and storing a reference to it in FK) + marking it as claimed
and the file being deleted.

Now we still fail in such a case, but no longer keep a file in the
database that's gone from storage.
The tags are not guaranteed to be sorted, so sometimes the re-render
caused by `setLoading(true)` resulted in the final-form's initialValues
changing and thus reinitializing the form, triggering the file manager's
logic to reset it as well and delete any pending files.

Since this happened in parallel with the submission of the reviewing
action, it at least resulted in the deleting request failing, but often
also in a race between the deletion request and it checking whether the
file has been claimed and the review claiming it, which resulted in the
file being deleted from storage but not the database (fixed in a
separate commit).
@ThiefMaster ThiefMaster added this to the v2.3 milestone Apr 12, 2021
@ThiefMaster ThiefMaster added this to In progress in Release 2.3 via automation Apr 12, 2021
@ThiefMaster ThiefMaster moved this from In progress to Review in progress in Release 2.3 Apr 12, 2021
@ThiefMaster ThiefMaster merged commit d5b0bb7 into indico:2.3-maintenance Apr 12, 2021
Release 2.3 automation moved this from Review in progress to Done Apr 12, 2021
@ThiefMaster ThiefMaster deleted the fix-filemanager-reset branch April 12, 2021 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Release 2.3
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant