Skip to content

fix(api): clean multimodal attachments in batch deletion - #41256

Open
hieheihei wants to merge 2 commits into
langgenius:mainfrom
hieheihei:bugfix/BUG-001-batch-delete-attachments
Open

fix(api): clean multimodal attachments in batch deletion#41256
hieheihei wants to merge 2 commits into
langgenius:mainfrom
hieheihei:bugfix/BUG-001-batch-delete-attachments

Conversation

@hieheihei

Copy link
Copy Markdown
Contributor

Summary

Fixes #41255

Clean binding-backed multimodal attachments during batch document deletion. The task now collects attachment IDs from SegmentAttachmentBinding, reuses the existing UploadFile and storage cleanup, and deletes bindings with their segments.

Validated with focused task tests (3 passed), make lint, make type-check, and a two-document browser E2E test.

Screenshots

Two documents selected with the batch delete action visible

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and vp staged (frontend) to appease the lint gods — frontend not changed

From Codex

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 61.14% 61.14% +0.00%
Strict coverage 60.73% 60.73% +0.00%
Typed symbols 41,940 41,942 +2
Untyped symbols 26,838 26,839 +1
Modules 3248 3248 0

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

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Batch deletion leaves multimodal attachment files orphaned

1 participant