Item 47: dispose-cleanup IconConverter + SvgRasterize /temp download copies#82
Merged
Merged
Conversation
…copies The Item 45 fix (MagicWand/ImageResize/FormatConverter) left two sibling imaging pages with the same leak: each conversion published a new wwwroot/temp web-copy without deleting the prior one, and navigate-away left the current copy for the 5-minute fallback timer. Mirror the Item 45 pattern on both pages: @implements IDisposable, track the current download copy, delete-prior on each new output (SetDownloadWebCopy), and delete on Dispose (navigate-away). Tracing was checked and is clean - it serves an inert data: URL, not a /temp file. Tests: new IconConverterPageTests (the page had none) + a SvgRasterize accumulation/dispose test, both driven in path mode (no JS picker). Full suite 706 -> 710 green.
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.
Fixes Item 47 — the Item 45 follow-on. Two imaging pages (
IconConverter,SvgRasterize) published awwwroot/tempweb-copy of their output on every conversion but never deleted the prior copy, and left the current one on navigate-away for a fire-and-forget 5-minute timer. This mirrors the Item 45 fix (MagicWand/ImageResize/FormatConverter) onto both:@implements IDisposable+ a tracked_downloadWebCopyPathSetDownloadWebCopy(bytes, ext)deletes the prior copy before publishing a new one (no accumulation)Dispose()deletes the tracked copy on navigate-away instead of waiting on the 5-minute fallback_downloadUrl = nullreset spots now callDeleteDownloadWebCopy()Tracing.razorwas checked and is clean — it serves an inertdata:image/svg+xmlURL, not a/tempfile, so there's nothing to leak.Tests
IconConverterPageTests(the page had no test) + an accumulation/dispose test added toSvgRasterizePageTests, both driven in path mode (no JS picker). Each asserts copies don't accumulate across two conversions and thatDispose()clears the tracked/tempcopy — both genuinely fail without the fix.Independent whole-branch review: ready to merge (no Critical/Important findings).