-
Notifications
You must be signed in to change notification settings - Fork 3
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
Editing a Project can delete uploads. #209
Comments
Seems like Hibernate is doing some thing with the data, based on assumptions. When we change project details, ProjectResource.java is using the updateProject REST method. This method eventually calls: When the save() method executes, Hibernate is doing the following 4 things (Haven't found this in the code, although I think it's buried in Spring somewhere, this is from the logs):
So Hibernate is doing quite presumptious things. Presumably because of foreign key relationships. |
Here are some of the foreign keys right now: fk_upload_upload fk_upload_project fk_upload_created_by_id fk_ihiw_user_lab_id fk_ihiw_user_user_id fk_validation_upload_id fk_project_created_by_id fk_project_modified_by_id To me none of this suggests uploads should delete when project is updated. |
Project.java and ProjectDTO.java have some changes that indeed allow the uploads to be carried along. (Branch feature/209) However the edit update form does not load/save these uploads. Some changes are still needed on project-update.component.ts |
As suggested by Matthias, the updateProject Rest method directly pulls the uploads from the database Seems to resolve the issue. |
"New and Exciting" issue with this deploy to staging, Possibly caused by these fixes, or maybe #196 or #211 deleteUpload is failing in some cases. The S3 file is indeed successfully removed, but Liquibase Hibernate is not deleting the database Upload row. To recreate the issue:
I do not see the bug when I do this:
I can see "Hibernate: delete from upload where id=?" In the log in this case. This does not appear in the error case. |
I can also recreate by
So i think uploadRepository is not finding the upload properly when I call deleteById(); and it is not directly caused by editing the project. |
This one's pretty nasty, when we edit a project, then some uploads assigned to the project can disappear. (stilll exist in S3 but the link seems to be gone)
Related: #202
The text was updated successfully, but these errors were encountered: