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

Moving file within dataset creates duplicate file view #312

Open
taywll252 opened this issue Jan 13, 2022 · 1 comment · May be fixed by #442
Open

Moving file within dataset creates duplicate file view #312

taywll252 opened this issue Jan 13, 2022 · 1 comment · May be fixed by #442
Assignees
Labels
bug Something isn't working

Comments

@taywll252
Copy link

Describe the bug
When trying to move a file located in a dataset folder to another folder within the same dataset (related to issue 37), a duplicate listing of the same file was produced. The file was shown in the root of a database AND still in the original parent folder.

Since there doesn't seem to be functionality to move between folders of the same dataset, user tried to make a workaround. The idea was to move the file back into the root of the dataset, then move the file into a different folder within the same dataset. Although probably not intended to be used in this way, the user selected the api/datasets/moveBetweenDatasets endpoint.

It seems to be an issue with the api/datasets/{datasetId}/moveBetweenDatasets/{toDataset}/{fileId} endpoint not handling a case where a user tries to move the file into the same dataset.

To Reproduce
Steps to reproduce the behavior:

  1. Upload a file to a dataset's folder (or select a file already uploaded to a dataset's folder)

  2. Move the file from the dataset's folder into the root of the dataset using /datasets/{datasetId}/moveBetweenDatasets/{toDataset}/{fileId} (datasetId and toDataset being the same ID)

    e.g. /api/datasets/1/moveBetweenDatasets/1/1234

  3. Check the dataset's root for the file AND check the folder where the file was supposed to be moved from

  4. See error where file is listed in both locations

Expected behavior
File is moved from the dataset folder into the root of the dataset, deleting the association with the old parent folder. Only 1 view/location of the file.

Desktop (please complete the following information):

  • OS: Windows 10
  • python 3.7 using API calls
  • Clowder Version 1.19.4
@taywll252 taywll252 added the bug Something isn't working label Jan 13, 2022
@lmarini lmarini assigned lmarini and unassigned lmarini Mar 9, 2022
@taywll252
Copy link
Author

taywll252 commented Mar 14, 2024

I'd actually forgotten I posted this issue until my team encountered this issue again today:

My team recently was using the /api/datasets/{dsID}/moveBetweenDatasets/{newdsID}/{fileID} and /api/datasets/{newdsID}/moveFile/{newfolderID}/{fileID} endpoints to transfer files from one dataset to another and then into a folder in the new dataset. The workflow was tested on 2 files to start.

We noticed that for both cases, the same exact file (same ID) was shown to exist in 2 places (visible through an API pull of the file information and in UI):

  1. File 1 was in the root of the new dataset and in the subfolder. This was resolved in the UI by using the "move" interface to move the root located file into the subfolder, where it seems the duplicate location association collapsed.
  2. File 2 was in the old AND new dataset, where the breadcrumb path actually showed a dropdown for the multiple Spaces which we've never seen before in the UI.

The issue seems to be connected to moveBetweenDatasets because my team has successfully used the "moveFile" endpoint to move files around within a dataset before without issue.

Clowder Version: 1.20.2#889 branch:master sha1:68baf98f0a7635f9059c9856e2fa6b92781e308f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants