Public forms are not removing locally stored media files after successfully finishing a submit. We are using object urls https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static to show new media files in the form fields (like we do for the metadata form). After a submission is done we should remove these objects from memory to avoid problems with the browsers' storage.
The public form is calling the cleanup method with the incorrect parameter (it should be the object url itself) at the incorrect time (it's calling it before submitting, so if the submission fails due to an incorrect captcha it would remove the object url causing problems for the next submit attempt).
Currently this is not breaking the public forms since we are not really deleting the object URL, so even if the user enters the wrong captcha, the object will remain in memory for the next submission attempt. But to fix the cleanup process we also need to delete these objects at the correct time (likely once the submission has successfully completed)
Public forms are not removing locally stored media files after successfully finishing a submit. We are using object urls https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL_static to show new media files in the form fields (like we do for the metadata form). After a submission is done we should remove these objects from memory to avoid problems with the browsers' storage.
The public form is calling the cleanup method with the incorrect parameter (it should be the object url itself) at the incorrect time (it's calling it before submitting, so if the submission fails due to an incorrect captcha it would remove the object url causing problems for the next submit attempt).
https://github.com/huridocs/uwazi/blob/b014e7ae462a9abd204030cd83d582d5c684809a/app/react/Metadata/helpers/wrapper.js#L39
Currently this is not breaking the public forms since we are not really deleting the object URL, so even if the user enters the wrong captcha, the object will remain in memory for the next submission attempt. But to fix the cleanup process we also need to delete these objects at the correct time (likely once the submission has successfully completed)