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 work deletion #6336

Merged
merged 1 commit into from
Oct 2, 2023
Merged

Fix work deletion #6336

merged 1 commit into from
Oct 2, 2023

Conversation

abelemlih
Copy link
Contributor

@abelemlih abelemlih commented Oct 2, 2023

Fixes

Fixes #6333

Summary

In valkyrie/fedora, deleting a work results in an error. The underlying issue is the application attempting to re-access a work on Fedora after it was deleted.

Guidance for testing, such as acceptance criteria or new user interface behaviors:

  1. Load sirenia (See Add config for valkyrie fedora and "sirenia" compose file #6331)
  2. Create a work
  3. Delete the work
  4. Verify work is deleted successfully without any errors

Type of change (for release notes)

  • notes-bugfix Bug Fixes

Detailed Description

A work deletion executes two transactions:

  • 'work_resource.delete'
  • 'work_resource.delete_acl'

In the previous ordering of these transactions, a work resource is deleted in Fedora, and then access to the resource is re-attempted when the work_resource.delete_acl transaction is processing. Specifically, work_resource.delete_acl involves finding the ACL using find_access_control_for(resource:) in app/services/hyrax/custom_queries/find_access_control.rb, which attempts to load the resource (work) on Fedora through Valkyrie. When a resource is deleted on Fedora and then an access is attempted, Fedora returns the error: Discovered tombstone resource at ....

Changes proposed in this pull request:

  • Reorder the transactions needed to delete a work by deleting the ACL first then the actual work on Fedora

@samvera/hyrax-code-reviewers

@abelemlih abelemlih marked this pull request as ready for review October 2, 2023 16:51
@dlpierce dlpierce merged commit 49d5625 into main Oct 2, 2023
4 checks passed
@dlpierce dlpierce deleted the abel-6333-fix_work_deletion branch October 2, 2023 20:54
@dlpierce dlpierce added the notes-bugfix Release Notes: Fixed a bug label Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-bugfix Release Notes: Fixed a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In valkyrie/fedora, deleting a work results in an error
2 participants