sul-dlss / purl-fetcher

An HTTP API for querying and updating PURLs
0 stars 1 forks source link

New publish/shelve API does not delete files from Stacks when files are changed to "shelve=no" #806

Closed andrewjbtw closed 3 weeks ago

andrewjbtw commented 1 month ago

Describe the bug When an item's rights are changed to dark, the publish and shelve settings are set to "no". That means that any files on Stacks should be removed when the accessionWF "shelve" step runs after the shelve settings were changed to no.

When I make an item dark in stage, I see the files are all left behind in Stacks.

User Impact Files don't get deleted when they should and are left without anyone knowing they're there. This is one of the ways the state of the Stacks filesystem falls out of sync with Cocina.

To Reproduce Steps to reproduce the behavior:

  1. Accession an item that has files and object rights set to something other than dark.
  2. After accessioning, open a new version and set its rights to dark.
  3. Close the item.
  4. Go to the Stacks filesystem and see that the files are still there.

Expected behavior Files should be deleted when an item is made dark. More specifically, if an item has files with "shelve=no", those files on Stacks should get deleted if they were previously on Stacks.

justinlittman commented 3 weeks ago

In addition, any files which are found on disk but are not in the cocina structural should be deleted.