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

There is no delete mechanism for attachments #677

Closed
2 of 4 tasks
couling opened this issue Jan 15, 2017 · 13 comments
Closed
2 of 4 tasks

There is no delete mechanism for attachments #677

couling opened this issue Jan 15, 2017 · 13 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Milestone

Comments

@couling
Copy link
Contributor

couling commented Jan 15, 2017

Refering to:

  • Gitea version (or commit ref): v1.0.0-126-g302fa42
  • Feature Request.

There is no delete mechanism at all for attachments.

  • The user should be presented with the option to delete any / all attachments from an issue comment.
  • Attachments should be deleted immediately when an issue / issue comment are deleted.
  • Attachments should be deleted immediately when a release is deleted
  • "Orphaned"Attachments should be deleted periodically (eg: cron job). Orphaned attachments have both attachment.CommentID and attachment.ReleaseId of 0. They occur when a user starts creating an issue, uploads an attachment and then closes the browser without submitting.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@tboerger tboerger added the type/enhancement An improvement of existing functionality label Jan 16, 2017
@tboerger tboerger added this to the 1.1.0 milestone Jan 16, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Jan 19, 2017

Also when a release is removed? (since that is now a thing 😄 #673 )

@couling
Copy link
Contributor Author

couling commented Jan 20, 2017

Actually it looks like the code tries to delete an attachment on deleting a comment.

See Here

However it doesn't manage to do so.

@couling
Copy link
Contributor Author

couling commented Jan 20, 2017

Okay so this doesn't trigger the AfterDelete(). I guess that's an xorm bug. I think for the time being I'm going to work around it and explicitly Delete the attachment in DeleteCommentById

@lunny
Copy link
Member

lunny commented Jan 20, 2017

change this to below code, then AfterDelete() will work.

if _, err = sess.Delete(&Comment{
ID: comment.ID,
}); err != nil {
		return err
	}

@appleboy
Copy link
Member

@lunny I will take it.

@appleboy
Copy link
Member

@lunny we need to merge this XORM PR first go-xorm/xorm#525

@appleboy
Copy link
Member

#704 also fix item two.

Attachments should be deleted immediately when an issue / issue comment or release are deleted.

cc @couling

@lunny lunny closed this as completed Feb 5, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Feb 28, 2017

These aren't all fixed.

@bkcsoft bkcsoft reopened this Feb 28, 2017
@ghost
Copy link

ghost commented Feb 28, 2017

The user should be presented with the option to delete any / all previously added attachments while editing a release.

@lunny lunny modified the milestones: 1.x.x, 1.1.0 Mar 1, 2017
@ghost
Copy link

ghost commented Mar 21, 2017

@gmastergreatee You are right! In addition to that, you cannot delete and recreate a release because it also deletes the git tag. One should split this.

@thmo
Copy link

thmo commented Sep 28, 2017

As an additional issue, the attachments remain on disk even after deleting the release itself (see #2618).

@stale
Copy link

stale bot commented Feb 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@6543
Copy link
Member

6543 commented Apr 29, 2021

closed by #14130

@6543 6543 closed this as completed Apr 29, 2021
@6543 6543 modified the milestones: 1.x.x, 1.15.0 Apr 29, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

7 participants