Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve attachments deletion#35103

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
lunny wants to merge18 commits intogo-gitea:main
base:main
Choose a base branch
Loading
fromlunny:lunny/fix_bug_delete_code_comment

Conversation

lunny
Copy link
Member

@lunnylunny commentedJul 16, 2025
edited
Loading

Refactor attachment deletion logic

The attachment of comment deletion process has been moved from theAfterDelete hook to the service layer. This change avoids scenarios where files are deleted while the database transaction is later rolled back. The new implementation introduces a two-stage deletion process using a status column to mark attachments as deleted. These marked attachments are excluded from all UI and API queries. A background cleanup queue is responsible for permanently deleting the files and then removing the corresponding database records. If file deletion fails repeatedly, a system notice will be issued to alert administrators.

Removed unused functions

DeleteAttachmentsByIssue andDeleteAttachmentsByComment are removed because only tests need them.

Fix#29715

Ensure that a review comment with no content is also deleted when its last associated code comment is removed.

Add API Support

Introduced API functionality for deleting code comments.

@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelJul 16, 2025
@github-actionsgithub-actionsbot added modifies/apiThis PR adds API routes or modifies them modifies/goPull requests that update Go code modifies/frontend labelsJul 16, 2025
@lunnylunny added the backport/v1.24This PR should be backported to Gitea 1.24 labelJul 16, 2025
@github-actionsgithub-actionsbot added the modifies/cliPR changes something on the CLI, i.e. gitea doctor or gitea admin labelJul 17, 2025
@lunnylunny removed the backport/v1.24This PR should be backported to Gitea 1.24 labelJul 17, 2025
@lunnylunny marked this pull request as draftJuly 17, 2025 07:04
@lunnylunnyforce-pushed thelunny/fix_bug_delete_code_comment branch from026b762 tof3d0e51CompareJuly 18, 2025 00:43
@github-actionsgithub-actionsbot removed the modifies/cliPR changes something on the CLI, i.e. gitea doctor or gitea admin labelJul 18, 2025
@lunnylunnyforce-pushed thelunny/fix_bug_delete_code_comment branch from4ae54c8 to97556a8CompareJuly 19, 2025 00:44
@lunnylunny changed the titleFix deleting code comment bugImprove attachments deletionJul 19, 2025
@lunnylunny added this to the1.25.0 milestoneJul 19, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
lgtm/need 2This PR needs two approvals by maintainers to be considered for merging.modifies/apiThis PR adds API routes or modifies themmodifies/frontendmodifies/goPull requests that update Go codemodifies/migrationsmodifies/translationtype/bug
Projects
None yet
Milestone
1.25.0
Development

Successfully merging this pull request may close these issues.

When deleting code review comment, the activity log will not be deleted
2 participants
@lunny@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp