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

filestore: Fix .info file not deleted if the binary file was successfully deleted #1214

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

bajelidze
Copy link
Contributor

@bajelidze bajelidze commented Nov 11, 2024

This PR fixes a bug where if the bin file was deleted without errors in the filestore, the .info file would not be deleted.

The main issue is that the !errors.Is(err, os.ErrNotExist) check is being made without checking that err is actually not nil. The nil value will pass this if case and the subsequent cleanup of .info file will not happen in that case because the function returns at that point.

I checked the fix in my setup and now it actually removes the .info file as well.

Copy link
Member

@Acconut Acconut left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!

@Acconut Acconut changed the title Fix .info file not deleted in filestore if the bin file was successfully deleted filestore: Fix .info file not deleted if the binary file was successfully deleted Nov 12, 2024
@Acconut Acconut merged commit 9d85248 into tus:main Nov 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants