Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Garbage collection for unreferenced attachments

Đang mở
#1,999 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, markdown
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu bằng việc đọc ngữ cảnh trong các issue #1623 và #1633 cũng như endpoint DELETE attachment hiện có. Issue này đưa ra một số trigger dọn dẹp khả dĩ nhưng không chọn một phương án nào; trước tiên hãy xác định một cách tiếp cận chấp nhận được để phân tích Markdown của note mà không ảnh hưởng đến hiệu năng sync, đồng thời xác định cách xử lý các đường dẫn tương đối nằm ngoài thư mục note. Hoàn thành có nghĩa là có một chiến lược dọn dẹp đã được thống nhất và triển khai, với các trường hợp biên của chiến lược đó được xử lý.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature request needs discussion

Follow up to #1623 and #1633.

Since #1633, API attachments live in a note's own .attachments. folder. The whole folder is removed when the note is deleted, and a single file can be removed through the new DELETE attachment endpoint. What is still missing is cleanup of attachments that are no longer referenced in a note's text.

When a user edits a note and removes an image or a link, the underlying file stays in .attachments. indefinitely, so orphaned files build up that nobody can reach from the note.

This was left out because finding unused attachments means parsing each note's Markdown to collect the referenced paths, which is the server side parsing we have tried to avoid for sync performance. So it needs a deliberate approach.

Options to consider:

  • On note save, parse the referenced paths and delete any file in that note's .attachments. folder that is no longer referenced.
  • A separate background or on demand job that does the same sweep across all notes.
    Leave deletion to clients through the DELETE endpoint and keep nothing automatic.

Open questions: which trigger is acceptable given the sync performance concern, and how to treat attachments referenced by relative paths that point outside the note's own folder.

Ngôn ngữ chính
JavaScript
Star
738
Fork
162
Merge trung bình
2 giờ 40 phút
Pull request đã merge (30 ngày)
39

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nextcloud/notes

Tất cả issue của nextcloud/notes

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.