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

infinite update loop for a dataset with two metadata files #2491

Open
jeanetteclark opened this issue Jul 26, 2024 · 2 comments
Open

infinite update loop for a dataset with two metadata files #2491

jeanetteclark opened this issue Jul 26, 2024 · 2 comments
Labels

Comments

@jeanetteclark
Copy link
Collaborator

Describe the bug

Found this strange edge case where metacatUI will get stuck in an infinite loop updating metadata documents when there is more than one metadata file in a package.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new dataset using metacatUI
  2. Run the following R script
library(dataone)
library(datapack)

d1c <- D1Client("STAGING", "urn:node:mnTestKNB")
resource_map_pid <- "{YOUR RM PID HERE}"

pkg <- dataone::getDataPackage(d1c, resource_map_pid)
emlFile <- system.file("extdata/strix-pacific-northwest.xml", package="dataone")
# add an additional metadata file
metadataObj <- new("DataObject", format="eml://ecoinformatics.org/eml-2.1.1", filename=emlFile)
# add a data file
sourceData <- system.file("extdata/OwlNightj.csv", package="dataone")
sourceObj <- new("DataObject", format="text/csv", filename=sourceData)
pkg <- addMember(pkg, sourceObj, metadataObj)
# Upload changes (new files) to package
uploadDataPackage(d1c, pkg, public = TRUE, accessRules=pkg@sysmeta@accessPolicy, quiet = FALSE)

  1. Go back to MetacatUI. In the dataset listing you'll see two recent datasets, the one you created on the web form and the Strix. Both of thse are associated with the same package. Click on the Strix dataset and edit it:
Screen Shot 2024-07-25 at 5 13 06 PM Screen Shot 2024-07-25 at 5 13 17 PM
  1. Make a minor edit to the title of the strix dataset
  2. Observe metacatUI switch back and forth updating the metadata documents, and look at the version chain for the non-Strix metadata.
Screen Shot 2024-07-25 at 5 14 48 PM

Expected behavior

...not this. I'm not sure what the expected behavior is here since the R code really had a bug in it (it should have replaced the metadata record and not added a new one). But I think theoretically multiple metadata documents is supported in the packaging model.

@jeanetteclark
Copy link
Collaborator Author

I should also add that I'll look into the resource map as well today since its also possible the package datapack created should not be allowed

@robyngit
Copy link
Member

Interesting. Thanks for reporting along with a very reproducible example @jeanetteclark !

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

No branches or pull requests

2 participants