Skip to content

Cleanup images from deleted comments#1702

Merged
umputun merged 1 commit intomasterfrom
paskal/cleanup_images_on_delete
Jan 20, 2024
Merged

Cleanup images from deleted comments#1702
umputun merged 1 commit intomasterfrom
paskal/cleanup_images_on_delete

Conversation

@paskal
Copy link
Copy Markdown
Collaborator

@paskal paskal commented Nov 18, 2023

Previously, images were deleted only from comments deleted before EditDuration expiration. After this change, any deletion of the comment deletes images if they are not used elsewhere in comments under the same page.

FS store got a mutex lock to prevent missing the file in the transition from staging to permanent storage, which otherwise would result in the file being stuck in the permanent storage forever.

Resolves #1698.

@paskal paskal added the backend label Nov 18, 2023
@paskal paskal requested a review from umputun as a code owner November 18, 2023 22:01
@paskal paskal force-pushed the paskal/cleanup_images_on_delete branch 2 times, most recently from d03cc8c to 1c2959c Compare November 18, 2023 22:08
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 18, 2023

Pull Request Test Coverage Report for Build 7512255642

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 84.772%

Totals Coverage Status
Change from base Build 7495000583: -0.02%
Covered Lines: 5962
Relevant Lines: 7033

💛 - Coveralls

@paskal paskal force-pushed the paskal/cleanup_images_on_delete branch from 1c2959c to fdef8b8 Compare November 18, 2023 22:45
@paskal paskal force-pushed the paskal/cleanup_images_on_delete branch from fdef8b8 to fd1b906 Compare January 13, 2024 11:55
Copy link
Copy Markdown
Owner

@umputun umputun left a comment

Choose a reason for hiding this comment

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

a few things I don't get. Probably it is just me, but anyway

Previously, images were deleted only from comments deleted
before EditDuration expiration. After this change, any deletion
of the comment deletes images if they are not used elsewhere
in comments under the same page.
@paskal paskal force-pushed the paskal/cleanup_images_on_delete branch from fd1b906 to c18ce3f Compare January 18, 2024 12:36
@umputun umputun merged commit 81c30e0 into master Jan 20, 2024
@umputun umputun deleted the paskal/cleanup_images_on_delete branch January 20, 2024 19:29
@paskal paskal added this to the v1.13.0 milestone Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image are not deleted once admin deletes a comment with it

2 participants