Skip to content

fix: delete file if exist before uploading another one #50

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

Closed
wants to merge 11 commits into from

Conversation

Turn0xx
Copy link
Contributor

@Turn0xx Turn0xx commented Oct 29, 2024

-I couldn't do this with one query because MySql doesn't support RETURNING clause
-For retriveal tests I had to build a clean state for them to work because they were depending on Upload tests

Issue: #38

Checklist

-I couldn't do this with one query because MySql doesn't support
RETURNING clause
-For retriveal tests I had to build a clean state for them to work
because they were depending on Upload tests
@jean-michelet
Copy link
Member

jean-michelet commented Nov 2, 2024 via email

Copy link
Member

@jean-michelet jean-michelet left a comment

Choose a reason for hiding this comment

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

Take a look at my feedbacks plz.

Besides that, LGTM!

- Generalize setup and tear down for all tasks image tests describe
blocks
- In replacing image upload test, assert that the old file is really
removed and the new file is persisted
Copy link

sonarqubecloud bot commented Nov 3, 2024

@jean-michelet jean-michelet requested a review from Fdawgs November 3, 2024 14:57
@jean-michelet
Copy link
Member

Can I merge @climba03003 @Fdawgs?

Copy link
Member

@climba03003 climba03003 left a comment

Choose a reason for hiding this comment

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

I would go for temporary file approach.

  1. Save the file with random name.
  2. Remove the old file.
  3. Move the tmp file to proper location.

It can ensure when the transaction is rollback or file upload is failed.
You still have the copy of old file.

@jean-michelet
Copy link
Member

Do you plan to terminate this PR @Turn0xx? Or should I terminate it for you?

@Turn0xx
Copy link
Contributor Author

Turn0xx commented Nov 26, 2024

@jean-michelet I plan to finish it, but i don't have much time this weeks so i don't know when.

@Fdawgs Fdawgs removed their request for review February 6, 2025 17:35
@jean-michelet jean-michelet mentioned this pull request Mar 30, 2025
@jean-michelet
Copy link
Member

Fixed by #93

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.

3 participants