desktop: pasted image breaks and send fails with "Failed to fetch" after the clipboard temp file is deleted
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- desktop-dev, typescript
- Domain
- desktop
Research direction
Start by reading packages/app/src/runtime/persistence/drafts.ts, especially putBlob and createBlobReference, then trace how pasted image bytes are stored and how the preview and blobDataUrl use the original File. Reproduce by pasting two images from a clipboard source that deletes the previous temp file; done means the first thumbnail remains visible and sending succeeds after that file is deleted.
Written by the indexing model from the issue text.
Description
Description
Pasting an image that the clipboard hands over as a temp file (on Windows, WeType / 微信输入法 keeps clipboard images in %LOCALAPPDATA%Low\Tencent\WeType\ClipboardTmp and deletes the previous one on every new copy) works at first. Once that temp file is gone, the thumbnail turns into a broken image and sending fails with "Failed to fetch". Pasting two images in a row is enough: the first one always breaks.
The bytes are already saved to the draft store on paste, but the preview and blobDataUrl still read the original File. Chromium reads a disk-backed File lazily, so the send goes back to the deleted file. I checked this in plain Chromium: once the file is deleted, fetch(URL.createObjectURL(file)) throws TypeError: Failed to fetch and an <img> with that URL fails to load. An in-memory copy of the same bytes keeps working.
Plugins
none relevant
OpenCode version
Desktop 1.19.5. The same code path is on dev (packages/app/src/runtime/persistence/drafts.ts, putBlob / createBlobReference)
Steps to reproduce
- On Windows with WeType's clipboard enabled, copy image A and paste it into the prompt.
- Copy image B. WeType deletes A's temp file. Paste B.
- A's thumbnail is now broken. Press send and you get "发送提示失败 / Failed to fetch".
Screenshot
No response
Operating System
Windows 10 Pro 22H2
Terminal
n/a (desktop app)
- Dominant language
- TypeScript
- Stars
- 224k
- Forks
- 30k
- Avg merge
- 6h 16m
- Merged PRs (30d)
- 507
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anomalyco/opencode
-
triaging
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anomalyco/opencode#62046 · 1 comment ·
Maintainers usually reply within 1 day
-
pending close triaging
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
anomalyco/opencode#62040 · 1 comment ·
Maintainers usually reply within 1 day
-
reproduced
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
anomalyco/opencode#62024 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anomalyco/opencode#61897 · 1 comment ·
Maintainers usually reply within 1 day
-
reproduced
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/opencode#61807 · 1 comment ·
Maintainers usually reply within 1 day
All issues in anomalyco/opencode
Similar issues
-
cloudflare-cache-binding: `unstorage://` keys are rejected by the Cache API, cache never storesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
strapi/design-system#2084 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
check:passed streams:remove
Difficulty 1/5 Under an hour Newbie friendliness 67/100
Maintainers usually reply within 1 day