-
Notifications
You must be signed in to change notification settings - Fork 9
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
Marking Whitehall attachments as deleted should delete corresponding Asset Manager assets when appropriate #509
Comments
Our latest thinking is to change Whitehall so that instances of |
I've merged alphagov/whitehall#3853 to address this. |
I'm currently testing this in integration. |
The following output from the Asset Manager Rails console in integration demonstrates that the main & thumbnail assets associated with a Whitehall PDF attachment are marked as deleted when the attachment is deleted in Whitehall. Before attachment deletedMain asset
Thumbnail asset
After attachment deletedMain asset
|
The following output from the Asset Manager Rails console in integration demonstrates that the main & thumbnail assets associated with a Whitehall PDF attachment are marked as deleted when the attachment's parent edition is discarded in Whitehall. Before draft edition discardedMain asset
Thumbnail asset
After draft edition discardedMain asset
Thumbnail asset
|
The above testing means I'm happy for this to be deployed to staging/production. |
@floehopper and I have just confirmed that this is working as expected in staging. We created a draft consultation, added an attachment and observed that we could access the attachment using both draft-origin (Whitehall) and draft-assets (Asset Manager). We then deleted the attachment from the consultation and observed that we could no longer view it using the draft-assets host. |
I've been considering this in Deleting a parent Whitehall document should delete underlying assets in Asset Manager, but have just realised that is outside the scope of that issue, so I'm creating this one. There are a bunch of comments on that issue which are relevant to this one.
Note that
Whitehall::AssetManagerStorage
does implement functionality for destruction of the uploader's model. Thus when anAttachmentData
is destroyed, a job is queued to delete the corresponding asset in Asset Manager. However, in the majority of cases when an attachment is deleted in Whitehall, theAttachmentData
is not destroyed. Thus there is more work to do and hence the need for this card.The text was updated successfully, but these errors were encountered: