IQSS / dataverse-frontend

An upcoming and modernized UI for Dataverse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FIx dataset loading logic for Deaccessioned Dataset

ekraffmiller opened this issue · comments

When a dataset is deaccessioned, it still should be visible to unauthenticated users, but only the citation and deaccession reason are viewable.
For example in JSF:
Screenshot 2024-01-04 at 1 45 21 PM

There is a bug in the SPA where getDatasetFilesTotalDownloadSize() is called for a deaccessioned dataset and an unauthenticated user. This API call returns an error because the user doesn't have permission to view the download sizes for a deaccessioned dataset. Because of this error, the SPA redirects to a published version of the dataset.
Screenshot 2024-01-04 at 1 52 17 PM

We need to update the logic of the SPA so that getDatasetFilesTotalDownloadSize() and other file related API's are only called if the user has permission to view the files. For example, if the dataset is deaccessioned, but the user has edit permissions on the dataset.

@ekraffmiller I attempted to replicate the issue and encountered an error with the 'get dataset deaccessioned' endpoint when the user is not authenticated. Therefore, I'm assuming you discovered this bug using a different image of Dataverse where the initial issue is resolved.

I tried running another image using ./run-env.sh 10207-bug-api-datasets-versions-latest-fix, but the 'get dataset deaccessioned' endpoint still fails when the user is unauthenticated.

I believe we need to first merge the above PR, as it currently seems impossible to open a deaccessioned dataset in the frontend if the user is unauthenticated.

Also, could you provide some steps on how to reproduce the bug regarding the 'getDatasetFilesTotalDownloadSize'?

I'm going to add the Waiting tag for the moment

Deprioritized and moved back to the SPA backlog.

This issue is not as important as others for the Beta Release and also requires further discussion.

@cmbz

@MellyGray I created a PR with steps to reproduce, I hope that makes sense, let me know if you have any questions or problems reproducing it