Skip to content

Item 47: dispose-cleanup IconConverter + SvgRasterize /temp download copies#82

Merged
bilbospocketses merged 1 commit into
masterfrom
fix/item47-imaging-temp-cleanup
Jun 24, 2026
Merged

Item 47: dispose-cleanup IconConverter + SvgRasterize /temp download copies#82
bilbospocketses merged 1 commit into
masterfrom
fix/item47-imaging-temp-cleanup

Conversation

@bilbospocketses

Copy link
Copy Markdown
Owner

Fixes Item 47 — the Item 45 follow-on. Two imaging pages (IconConverter, SvgRasterize) published a wwwroot/temp web-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 _downloadWebCopyPath
  • SetDownloadWebCopy(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
  • the _downloadUrl = null reset spots now call DeleteDownloadWebCopy()

Tracing.razor was checked and is clean — it serves an inert data:image/svg+xml URL, not a /temp file, so there's nothing to leak.

Tests

  • New IconConverterPageTests (the page had no test) + an accumulation/dispose test added to SvgRasterizePageTests, both driven in path mode (no JS picker). Each asserts copies don't accumulate across two conversions and that Dispose() clears the tracked /temp copy — both genuinely fail without the fix.
  • Full suite 706 → 710 green.

Independent whole-branch review: ready to merge (no Critical/Important findings).

…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.
@bilbospocketses bilbospocketses enabled auto-merge (squash) June 24, 2026 22:56
@bilbospocketses bilbospocketses merged commit fbffe73 into master Jun 24, 2026
8 checks passed
@bilbospocketses bilbospocketses deleted the fix/item47-imaging-temp-cleanup branch June 24, 2026 22:58
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.

1 participant