Open beepsoft opened 10 months ago
FWIW: I'd say this is more 'as designed'. If you (or someone else) can edit a data in one window, and you can publish in another, you'd potentially be publishing something you haven't seen. It would probably help to have a better error message, i.e. the dataset may have changed since you've viewed it, please refresh the page before publishing. (Note I say may have because some changes to a dataset are things like it now being indexed which wouldn't be a change to dataset as seen by the user.)
A message to the user forcing to reload the page seems a good solution to me. (In case of the new SPA UI it maybe a good idea to have a websocket like mechanism as well to get notifications of such changes.)
The underlying data may change via API calls or by some other processes (in our case because of our RO-Crate editor's update of a dataset's data), so it is definitely necessary to notify the user that what they see on screen are out of sync with the underlying data.
What steps does it take to reproduce the issue?
Publishing will fail with this error:
And the
message will be displayed indefinitely because the dataset will remain in a locked state forever because of the previous error
When working with the same dataset in multiple browser tabs and doing editing in one tab and pubishing in another one.
Any user.
Publishing should not fail no matter how many tabs the dataset is edited in.
Which version of Dataverse are you using?
6.0
Screenshots:
Possible solution
The cause of the problem seems to be that the UI state is stored in a DataversePage object and it has an instance of the Dataset, which have already changed in the database:
https://github.com/IQSS/dataverse/blob/3305c4a41045d0bb2f261c5eb2aa93414a34f2c6/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java#L2753-L2759
Here at line 2756 doing something like this before submitting the
PublishDatasetCommand
would resolve this issue: