8000 Deleted image thumbnails were not deleted · Issue #16 · longern/FlareDrive · GitHub
[go: up one dir, main page]

Skip to content

Deleted image thumbnails were not deleted  #16

Open

Description

@mxz94
No description provided.

Activity

  1. longern commented on Sep 6, 2024

    @longern
    Owner

    The thumbnails are shared when copying or uploading duplicate files. I haven't thought of a safe solution to delete the thumbnails yet.

  2. fanchenggang commented on Sep 6, 2026

    @fanchenggang

    Hi! I'd like to take this one. I maintain Davflare, a FlareDrive derivative, and hit the same problem there.

    Root cause: thumbnails are content-addressed (_$flaredrive$/thumbnails/<digest>.png) and intentionally shared between files with identical content, and functions/webdav/delete.ts never cleans them up, so they accumulate as orphans.

    Proposed safe solution — per-path reference markers (no counters, no read-modify-write):

    • On upload/copy (put.ts, multipart create in post.ts, copy.ts): before writing the destination object, PUT an immutable marker object _$flaredrive$/thumbnails/refs/<digest>/<path>.
    • On delete (delete.ts, file or recursive directory): remove the file's marker, then list refs/<digest>/ — only when no markers remain, delete thumbnails/<digest>.png.
    • Markers are written before the referencing object and removed before the reference disappears, so a concurrent delete can at worst over-retain a thumbnail (same as today's behavior), never break one that is still in use.
    • Thumbnails uploaded before this change have no markers, so they are conservatively retained rather than risk breaking duplicates that share them.

    Happy to send a PR if this direction sounds good.

  3. fanchenggang commented on Sep 6, 2026

    @fanchenggang

    PR: #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0