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

Update File Metadata API for Published dataset should be accessible #11208

Open
ChengShi-1 opened this issue Feb 3, 2025 · 1 comment
Open
Labels
Feature: Metadata GREI Re-arch Issues related to the GREI Dataverse rearchitecture Size: 3 A percentage of a sprint. 2.1 hours. SPA These changes are required for the Dataverse SPA Type: Bug a defect

Comments

@ChengShi-1
Copy link

What steps does it take to reproduce the issue?

  • In JSF, create a dataset with a file
  • test the api, post .../api/v1/files/{fileID}/metadata , works well
  • publish the dataset
  • test the api, post .../api/v1/files/{fileID}/metadata , 400 error occurs
  • When does this issue occur?
    When I use post .../api/v1/files/27/metadata from native api to edit file metadata, if the dataset of the file is published, the result would be a 400 error { "status": "ERROR", "message": "Filename already exists at blob" }(blob is the file name I upload)

  • Which page(s) does it occurs on?
    File, update file metadata api

  • What happens?

  • To whom does it occur (all users, curators, superusers)?
    api users

  • What did you expect to happen?
    No matter what the dataset status is, should be able to edit file metadata

Which version of Dataverse are you using?
api

Any related open or closed issues to this bug report?
#IQSS/dataverse-client-javascript#213

@ChengShi-1 ChengShi-1 added Feature: Metadata GREI Re-arch Issues related to the GREI Dataverse rearchitecture SPA These changes are required for the Dataverse SPA Type: Bug a defect labels Feb 3, 2025
@qqmyers
Copy link
Member

qqmyers commented Feb 3, 2025

Good catch. Looks like this happens when a new draft version is created. The intent is to check the name you're sending in against the names of all other files, but the loop at

for (FileMetadata fileMetadata : fmdList) {
if (!fileMetadata.equals(df.getFileMetadata())) {
fmdListMinusCurrentFile.add(fileMetadata);
}
is trying to remove the filemetadata for the file being changed that is in the published version from the list of all filemetadatas in the new draft version. (Since it isn't in there, the following code finds a file name conflict with the file you're changing.)

@ChengShi-1 ChengShi-1 moved this to This Sprint 🏃‍♀️ 🏃 in IQSS Dataverse Project Feb 4, 2025
@ChengShi-1 ChengShi-1 added the Size: 3 A percentage of a sprint. 2.1 hours. label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Metadata GREI Re-arch Issues related to the GREI Dataverse rearchitecture Size: 3 A percentage of a sprint. 2.1 hours. SPA These changes are required for the Dataverse SPA Type: Bug a defect
Projects
Status: This Sprint 🏃‍♀️ 🏃
Development

No branches or pull requests

2 participants