Repository navigation
Fix image preview copy performance by using a worker for encoding - #341783
Merged
Logan Ramos (lramos15) merged 2 commits intoOct 15, 2026
Merged
Logan Ramos (lramos15) merged 2 commits into
Logan Ramos (lramos15) merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Synchronous bitmap-transfer failures bypass cleanup and leak resources.
1 open finding
What changed in this PR
Addresses delayed image-preview copying in #341527 by moving PNG encoding to a worker.
Changes:
- Adds worker-based encoding with a main-thread fallback.
- Allows blob workers in the preview’s content security policy.
| File | Description |
|---|---|
| extensions/media-preview/src/imagePreview/index.ts | Permits blob workers. |
| extensions/media-preview/media/imagePreview.js | Adds worker encoding and fallback handling. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Logan Ramos (lramos15)
disabled auto-merge
October 15, 2026 14:38
If postMessage throws synchronously (for example a DataCloneError for a bitmap that isn't origin-clean), neither worker handler runs, so the worker, its blob URL and the bitmap were never released. Repeated failed copies could accumulate them. Handle worker creation, handler setup and the transfer under one try so every synchronous failure cleans up before falling back to toBlob(). Refs #341527 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Henning Dieterichs (hediet)
approved these changes
Oct 15, 2026
Logan Ramos (lramos15)
enabled auto-merge (squash)
October 15, 2026 14:45
Logan Ramos (lramos15)
disabled auto-merge
October 15, 2026 14:45
Logan Ramos (lramos15)
enabled auto-merge (squash)
October 15, 2026 14:45
Logan Ramos (lramos15)
deleted the
lramos15/agents/fix-terminal-encoding-issue-88636145
branch
October 15, 2026 15:12
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.

Fix #341527