RocketChat / RocketChat/Rocket.Chat

Auto-delete files with zero links

Open
#5,621 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

security
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

If deleting a message including a file, the file won't vanish from filesystem (in GridFS not noticeable, as you don't access it normally), even if the message is the last occurrence of a link to the file. It does no longer show up in attachment overview on the right bar, too.
So an "easy" check for number of links to a file when deleting a message would save space (especially for AWS) and may reduce problems (which may occur if uploads are unprotected or perhaps someone stored the link to the file, which shouldn't be posted/uploaded).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue concerns message deletion and the attachment overview; start by tracing how deleting a message handles its linked files and how the overview determines remaining links. Done means a file with no remaining message links is removed from storage without breaking the attachment overview, including the GridFS case.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, mongodb, typescript
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.