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

Edit or delete committee members leaves orphaned records in fedora #1733

Open
val99erie opened this issue Aug 21, 2018 · 1 comment
Open

Comments

@val99erie
Copy link
Contributor

Steps to reproduce the problem:

  • In the rails console, create an Etd record with committee chairs and members:
cm_attrs = [
  { name: ['Frodo'], affiliation: ['Emory University'] },
  { name: ['Bilbo'], affiliation: ['University of Bilbo'] }
]

cc_attrs = [
  { name: ['Gandalf'], affiliation: ['Emory University'] }
]

etd = Etd.new(title: ['ETD 1'], committee_members_attributes: cm_attrs, committee_chair_attributes: cc_attrs)

etd.save!
  • Look at the Etd record in the fedora console.

  • Notice that the committee chair is correctly listed in the ths predicate, and the committee members are correctly listed in the rev predicate.

  • Scroll to the bottom of the page to the 'Other Resources' section, and notice 3 nested records (1 for the chair and 2 for the members).

  • So far, everything is correct in fedora.

  • Now go back to the rails console and delete the 2 committee members:

etd.committee_members = nil
etd.save!
  • Go back to the fedora console, and reload the page.

  • Notice that the rev predicate has disappeared from the record (as expected).

  • But down in the 'Other Resources' section, you still see 3 child resources, even though you would expect to see only 1.

Expected Result:

The 2 child resources should have been removed from the work's record in fedora.

Actual Result:

The 2 (orphaned) child resources still exist in fedora.

@val99erie
Copy link
Contributor Author

Here's another clue:

If I try to delete an individual committee member with committee_member.destroy, it returns true, but the committee member didn't actually get deleted.

I stepped through the code and saw a transaction rollback:
<RDF::Transaction::TransactionError: Error merging transaction. Repository has changed during transaction time.>

I asked @no-reply about it, and he suspects that the parent work's committee_members field got updated during the middle of the transaction to update the nested record, so the transaction rolled back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant