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

[Postgres] CONSTRAINT unique_ingested only looks at the submission_file_path and the archive_file_path #1230

Open
3 tasks
jbygdell opened this issue Dec 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jbygdell
Copy link
Collaborator

Describe the bug

Since we prefer not to leak the submitter ID from the file path of the uploaded file we need to make sure that the constraint in the SQL schema doesn't only look at the submission file path and whether or not the file has been ingested already before giving it an ID.

Related to #1097

Steps to reproduce

Start the postgres container in any way you like.
Exec into the container and run the following queries.

SELECT sda.register_file('path/to/testfile.ex', 'testuser');
SELECT sda.register_file('path/to/testfile.ex', 'another-user');

You will see that the returned IDs are identical since the CONSTRAINT unique_ingested only looks at the submission_file_path and the archive_file_path

Expected behavior

  • Multiple users should be able to submit files with the exact same file path at the same time.
  • A user should be able to submit files with the same name several times, given that the previous file has been ingested.
  • Tests verifying the fix are added

Additional context

Estimation of size

small

Estimation of priority

low

@jbygdell jbygdell added the bug Something isn't working label Dec 30, 2024
@jbygdell jbygdell changed the title [Postgres] CONSTRAINT unique_ingested only looks at the submission:file_path and the archive_file_path [Postgres] CONSTRAINT unique_ingested only looks at the submission_file_path and the archive_file_path Jan 7, 2025
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

No branches or pull requests

1 participant