Skip to content

Allow deleting corrupt or incomplete datasets - #1830

Open
mattdawkins wants to merge 1 commit into
mainfrom
dev/delete-corrupt-datasets
Open

Allow deleting corrupt or incomplete datasets#1830
mattdawkins wants to merge 1 commit into
mainfrom
dev/delete-corrupt-datasets

Conversation

@mattdawkins

Copy link
Copy Markdown
Member

A dataset whose import died before dataset.json was written can never be deleted from the Recents list — delete-dataset fails with missing metadata json file <path>.

  • deleteDataset() no longer runs getValidatedProjectDir(); it removes the project directory whatever state it's in, loads the dataset json only opportunistically for the DIVE_Jobs_Output cleanup, returns true when the directory is already gone, and rejects ids resolving outside DIVE_Projects.
  • getValidatedProjectDir() checks the base path before ensureDirSync(aux), so failed lookups stop creating stub <id>/auxiliary/ dirs — which is what made the ghost entries reappear after manual cleanup.

Tests updated for the new behavior, 3 added.

deleteDataset() validated the project first, so a dataset whose import
died before dataset.json was written could never be removed from the UI.
getValidatedProjectDir() also created aux/ before checking the base path
existed, resurrecting stub directories on every failed lookup.
@BryonLewis

Copy link
Copy Markdown
Collaborator

I think I just just autosync on launch ofthe electorn version, this would make sure that broken things are removed and it just suggest to run autosync if you try to open/delete a non-existing item

@mattdawkins

Copy link
Copy Markdown
Member Author

I'm not sure 'sync to delete' is readily known to users (or me)

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.

2 participants