Skip to content

fix: recover from image upload failures in the editor#1015

Open
kptdobe wants to merge 2 commits into
mainfrom
imgdrop
Open

fix: recover from image upload failures in the editor#1015
kptdobe wants to merge 2 commits into
mainfrom
imgdrop

Conversation

@kptdobe

@kptdobe kptdobe commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When daFetch throws or returns a non-ok response during image drag-and-drop upload, the FPO placeholder (fpo.svg) is now removed from the document instead of being left stuck permanently
  • A red toast notification is shown to the author: "Failed to upload "filename". Please try again." — auto-dismisses after 5 s
  • If the upload succeeds but the content URL fails to render (broken CDN, slow propagation), the placeholder is still replaced with the real URL so it isn't stuck as fpo.svg either

Root cause

On Windows, dragging an image from File Explorer into the editor can cause the upload PUT request to fail (browser navigation to a file:/// URI competing with the upload, or corporate proxy blocking requests to the .grs path). The original code had no error recovery — any failure silently left the FPO placeholder in the document, and since it was already synced to the Yjs collab layer, it persisted across reloads.

Test plan

Test page: https://imgdrop--da-live--adobe.aem.page

  • Drag and drop an image on Mac/Chrome — image uploads and replaces the FPO as before
  • Simulate upload failure (DevTools → block the PUT request) — FPO is removed, toast appears
  • All unit tests pass (npm test)

🤖 Generated with Claude Code

kptdobe and others added 2 commits June 18, 2026 10:27
At the org level (path depth 1), clicking New skips the type menu and
goes straight to folder-name input. At site level and deeper the full
menu (Document, Sheet, Media, Link, Folder) is preserved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When daFetch returns a non-ok response or throws (e.g. on Windows where
drag-and-drop from File Explorer can conflict with the upload), the FPO
placeholder is now removed from the document and a dismissing toast is
shown to the author. Previously the placeholder stayed stuck forever.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Jun 18, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

@kptdobe

kptdobe commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Validating with customer.

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