Skip to content

Fix/media download http errors 3852 - #3885

Merged
Richard Lundeen (richlundeen) merged 15 commits into
microsoft:mainfrom
aspire488:fix/media-download-http-errors-3852
Nov 14, 2026
Merged

Richard Lundeen (richlundeen) merged 15 commits into
microsoft:mainfrom
aspire488:fix/media-download-http-errors-3852

Conversation

@aspire488

Copy link
Copy Markdown
Contributor

Description

Tests and Documentation

Summary

  • Check HTTP response status before converting attachment downloads into blobs.
  • Prevent failed HTTP responses from being downloaded as image files.
  • Display an inline, retryable error message when a download fails.
  • Keep the download action available so users can retry.
  • Add regression coverage for an HTTP 404 followed by a successful retry.

Testing

  • Added regression test in frontend/src/components/Chat/MessageList.test.tsx.
  • Verifies that failed responses do not create object URLs or trigger downloads.
  • Verifies that retrying after a failure succeeds and clears the error message.
  • Tests have not been run locally.

Fixes #3852

Copilot AI balanced review requested due to automatic review settings November 3, 2026 13:47

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.

🟡 Changes recommended

Download errors can leak between conversations because they are keyed by list position, and the 404 test can pass even if the HTTP status check is removed.

2 open issues
What changed in this PR

This PR addresses #3852 in PyRIT’s chat interface by rejecting failed HTTP responses before downloading media and showing retryable inline errors.

Changes:

  • Check HTTP status before converting media responses into downloadable blobs.
  • Replace the new-tab fallback with an inline error while keeping Download available.
  • Add a 404-then-success retry test and update the successful-response mock.
File Description
frontend/​src/​components/​Chat/​MessageList.tsx Validates download responses and displays retryable errors.
frontend/​src/​components/​Chat/​MessageList.test.tsx Adds failure-and-retry coverage and updates download mocks.

Review effort: Balanced

@richlundeen

Copy link
Copy Markdown
Contributor

review:5753321665

Both concerns summarized in this review are addressed at this head: the 404 test exercises an error blob, and transient download errors are scoped to the conversation and attachment. The inline replies contain the specific evidence.

Verified on published commit 49a751b85db6e0bdcc5946cc987e4d7a24fa949b.

Preserve conversation-scoped download errors and main's copy/branch disabled-reason behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Nov 14, 2026
Merged via the queue into microsoft:main with commit c33dc50 Nov 14, 2026
59 checks passed
@aspire488

Copy link
Copy Markdown
Contributor Author

Thanks to the PyRIT maintainers for reviewing and merging this PR!

I appreciate the feedback throughout the process. It was great to contribute the HTTP download error handling and retry behavior, along with regression coverage for failed downloads.

Looking forward to contributing more to PyRIT and helping improve the project!

Richard Lundeen (richlundeen) added a commit to WatchTree-19/PyRIT that referenced this pull request Nov 14, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Chat media Download saves HTTP error bodies as image files

3 participants