Skip to main content

Give each image upload attempt its own AbortController

Updated 1 min readMarkdown

Make image-upload cancellation belong to one attempt. A new attempt needs a fresh controller and a cancel control that still points to it.

Keep the controller with the job identifier. When the user cancels, call that job's controller.abort(). Do not use an older job's cancel control to stop a newer upload that now occupies the same result panel.

With no custom reason, aborting uses an AbortError reason. A canceled attempt should have its own interface state rather than being labeled as an accepted image. Start a retry with a new controller instead of reusing an already-aborted signal.

The MDN abort() reference describes cancellation of fetch and response consumption. Treat the server's saved state as a separate application question: a browser cancel action is not a deletion request to the upload service.

I work on Morphio, our image project at https://morphio.online/. These notes describe image preparation and review; they do not require a particular editing tool.

1 view

About the author

  • I build Morphio, an online toolkit for working with image formats, including HEIC conversion. I share practical notes on image processing and web tools.

No comments yet. Be the first to comment.