Skip to content

FIX: revoke removed attachment blob URLs in the conversation editor - #3186

Merged
Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
ManoharPaturi:fix/editor-attachment-url-revoke
Oct 14, 2026
Merged

Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
ManoharPaturi:fix/editor-attachment-url-revoke

Conversation

@ManoharPaturi

Copy link
Copy Markdown
Contributor

Description

Fixes #3185

ChatInputArea.changeAttachments revokes a removed attachment's blob object URL, but the conversation editor path (ConversationEditor calling into useConversationDraft.changeAttachments) forwarded the new attachment list with no revocation, so removing an attachment in the editor pinned its blob: URL and File payload until the draft was discarded or the editor unmounted. The editor now revokes the media piece's blob URL when the incoming attachment list no longer references it, matched by URL since the draft attachment object is rebuilt each render.

Tests and Documentation

Added revokes the blob URL when an attachment is removed from the editor to ConversationEditor.test.tsx: it uploads a file through the editor, removes it, and asserts URL.revokeObjectURL was called with the attachment's blob URL. Fails on main, passes with the change. The full ConversationEditor.test.tsx and ChatWindow.test.tsx suites pass (219 tests) and tsc --noEmit is clean.

No documentation change needed, so I did not run JupyText.

The chat composer revokes a dropped attachment's blob object URL when
the attachment is removed, but the conversation editor forwarded the new
attachment list straight through, so removed files stayed pinned until
the draft was discarded or the editor unmounted. Revoke the media
piece's blob URL when the next list no longer references it.

Fixes microsoft#3185

Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 16:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 49f13576-5cf7-4b3d-beba-39e00c34aca4
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 49f13576-5cf7-4b3d-beba-39e00c34aca4
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 49f13576-5cf7-4b3d-beba-39e00c34aca4
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 14, 2026
Merged via the queue into microsoft:main with commit 965d478 Oct 14, 2026
76 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conversation editor never revokes blob URLs of removed attachments

3 participants