fix(editor): decouple description uploads from attachment records

Description editor uploads no longer pass issueId to the upload API.
This avoids stale attachment records when users delete images from
the editor — the URL already lives in the markdown content.

Comment/reply uploads continue linking to the issue for agent discovery.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Naiyuan Qing
2026-04-09 15:33:08 +08:00
parent 8526f013da
commit 80afd1cc00

View File

@@ -336,9 +336,11 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo
);
const descEditorRef = useRef<ContentEditorRef>(null);
// Description uploads don't pass issueId — the URL lives in the markdown.
// This avoids stale attachment records when users delete images from the editor.
const handleDescriptionUpload = useCallback(
(file: File) => uploadWithToast(file, { issueId: id }),
[uploadWithToast, id],
(file: File) => uploadWithToast(file),
[uploadWithToast],
);
const deleteIssueMutation = useDeleteIssue();