Conversation
sourcery-ai
Bot
dismissed
their stale review
September 19, 2026 05:14
Sourcery withdrew this approval because the latest commits introduced blocking findings.
Soulter
approved these changes
Sep 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
PreProcessStage detached every resolved image path from event cleanup. When a data URI or remote reference materialized invalid bytes, the path was treated as a durable attachment even though image processing had failed, leaving a
media_image_*file behind.Reproduction
On Windows with Python 3.12, passing an invalid
data:image/png;base64reference through PreProcessStage and then running event cleanup left the materialized file on disk. The regression occurred for both ordinary and Reply-chain images.Fix
Verification
uv run pytest -q: 2968 passed, 1 skippeduv run pytest -q tests/test_preprocess_stage.py tests/test_media_utils.py tests/test_mattermost_adapter.py: 89 passeduv run ruff check .: passeduv run ruff format --check .: 505 files already formattedRelated: #10042
Summary by Sourcery
Ensure invalid materialized images remain owned by their events so cleanup removes them after preprocessing fails.
Bug Fixes:
Enhancements:
Tests: