NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
41 stars 26 forks source link

PROV editor hangs and produces spurious calls to `updateSystemMetadata` #1325

Closed amoeba closed 4 years ago

amoeba commented 4 years ago

I was doing testing for something else and ran into this:

Steps:

  1. Create a new package with the Editor with the bare-bones metadata required and add two files (A, B)
  2. After creating, navigate to the landing page
  3. Add a relationship such as A is an input to B
  4. Click Submit when it shows up

You'll see Submit change to "Saving..." and stay there indefinitely. In your Network console you'll see three PUT calls that error out with HTTP 400s that look like calls to updateSystemMetadata. This is a bit weird as I wouldn't expect adding PROV to call updateSystemMetadata at all.

Updating PROV eventually triggers a save call on the DataPackage collection and the logic causing the failing calls happens in:

https://github.com/NCEAS/metacatui/blob/0eddbf197708ddff08396a06e7db0ae93eb7a3a5/src/js/collections/DataPackage.js#L1110-L1115

The error response might be diagnostically useful. Each call returns with:

<error>
  <description>
    The system metadata modification date can't be null.
  </description>
</error>

Chrome 80.0.3987.87 MetacatUI versions: 2.10.0 and 2.10-dev (can reproduce on test.arcticdata.io)

gothub commented 4 years ago

@laurenwalker could you have a look at this? If only prov is being updated, no models are updated, just the resource map. Does the DataPackage.saveProv() function need to mark all package models so that they don't get updated, according to this recent update: https://github.com/NCEAS/metacatui/blame/0eddbf197708ddff08396a06e7db0ae93eb7a3a5/src/js/collections/DataPackage.js#L1110-L1115