NCEAS / morpho

Morpho metadata editor
GNU General Public License v2.0
3 stars 1 forks source link

Get a system metadata version number error when morpho tried to change the access policy of a network document #1029

Closed mbjones closed 6 years ago

mbjones commented 6 years ago

Author Name: Jing Tao (Jing Tao) Original Redmine Issue: 5882, https://projects.ecoinformatics.org/ecoinfo/issues/5882 Original Date: 2013-02-22 Original Assignee: ben leinfelder


When I tried to change the access rule of a network document, i got this error:

The requested system metadata version number 0 differs from the current version at 1. Please get the latest copy in order to modify it.

Here is what i did:

  1. Used the new data package wizard to create an new eml only document and saved it to the network.

  2. Chose Documentation|Access Information to add a new access rule and got an error - the cn doens't have the id and please try again later.

  3. A while later, i clicked the Documenation|Access Information again (I didn't close the data package) and I saw the new rules i added in previous step (this is a little bit confusing - users may think the new rule already has been added). Then i clicked the okay button and got this error.

mbjones commented 6 years ago

Original Redmine Comment Author Name: ben leinfelder (ben leinfelder) Original Date: 2013-02-23T05:26:25Z


If you reopen the package, you should get the updated SystemMetadata (serial version 1) and be able to update the access policy at that point. When the CN harvests the object from the MN it increments the serial version number (because it modifies some other system metadata fields). We want users to get have the latest version when they are updating.

I agree that it is a little confusing to have the changes you made still there even after an error, but they will go away if you close the package. The alternative would be to save the existing access policy and in case of errors we would overwrite their modifications. But If I'd spent a while writing access rules and then they were all erased because of an error I'd be pretty upset. But I guess with the serial version error I'd have to close the package anyway and loose my changes.

We could just grab the latest serial version number when we make any setAccess call, but that defeats the purpose of having the field in the first place.

mbjones commented 6 years ago

Original Redmine Comment Author Name: ben leinfelder (ben leinfelder) Original Date: 2013-02-23T07:49:40Z


Until we have a better solution, I have changed the code to always look up the latest serialVersion from the CN before calling setAccessPolicy (and setReplicationPolicy). This means we will unknowingly overwrite any changes that were made by, say, someone else. Ideally we would refresh the UI with the the access policy found on the CN when we detect that the versions do not match. But we also discussed at the most recent CCIT meeting making the MN authoritative for access policy changes.

mbjones commented 6 years ago

Original Redmine Comment Author Name: Redmine Admin (Redmine Admin) Original Date: 2013-03-27T21:31:59Z


Original Bugzilla ID was 5882