Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Fix tempfile naming in download manager #195

Merged
merged 2 commits into from
May 22, 2024

Conversation

tuommaki
Copy link
Contributor

When multiple files with same name, but different extension are submitted for download concurrently, there was a conflict with the filename.

This change fixes by adding ".tmp" to filename instead of replacing the whole extension.

When multiple files with same name, but different extension are
submitted for download concurrently, there was a conflict with
the filename.

This change fixes by adding ".tmp" to filename instead of replacing
the whole extension.
@tuommaki tuommaki self-assigned this May 22, 2024
Copy link

@trusch trusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm except that the serving logic needs to be adapted. Your changes ADD .tmp as an extension but in the serving function the check that looks for temp files sets the extension, overwriting the existing one.

@tuommaki
Copy link
Contributor Author

Your changes ADD .tmp as an extension but in the serving function the check that looks for temp files sets the extension, overwriting the existing one.

Whoops! That was a very good catch! Thanks! Extracted the functionality and used it in both.

@tuommaki tuommaki merged commit 8134615 into main May 22, 2024
4 checks passed
@tuommaki tuommaki deleted the fix-download-manager-tmpfile-naming branch May 22, 2024 08:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants