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

i16 Expand AssetDestroyer to also destroy AssetResources #861

Merged
merged 6 commits into from
Apr 23, 2024

Conversation

bkiahstroud
Copy link
Collaborator

expand AssetDestroyer to also delete AssetResources

ef949bb

don't set validation status on deleted Asset

ae13cd1

Prevents the following error when deleting an AssetResource via the
Valkyrie Transactions:

SolrDocument#get_members: undefined method 'members' for AssetResource

Setting the validation status required looking up the Asset's members
recursively. But since we're in the middle of deleting things:

  1. Expected data was missing, and more importantly,
  2. We don't care about setting the Asset's validation status because
    it's being deleted

use transaction to thoroughly delete members

1a0a4a6

The Transaction ensures the members will be deleted thoroughly. For
example, using the transaction means all the related Sipity records will
be destroyed, which is what we want

Prevents the following error when deleting an AssetResource via the
Valkyrie Transactions:

`SolrDocument#get_members: undefined method 'members' for AssetResource`

Setting the validation status required looking up the Asset's members
recursively. But since we're in the middle of deleting things:

1. Expected data was missing, and more importantly,
2. We don't care about setting the Asset's validation status because
   it's being deleted
The Transaction ensures the members will be deleted thoroughly. For
example, using the transaction means all the related Sipity records will
be destroyed, which is what we want
afred
afred previously approved these changes Apr 23, 2024
Copy link
Contributor

@afred afred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

This should fix specs that are failing in CI
@afred
Copy link
Contributor

afred commented Apr 23, 2024

👍

Copy link
Contributor

@afred afred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@afred afred merged commit 567d7b7 into develop Apr 23, 2024
6 checks passed
@afred afred deleted the i16-asset-annihilator branch April 23, 2024 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants