- assigned_to: BilgeGates
Originally created by: BilgeGates
Originally owned by: BilgeGates
In exportRaster.ts, canvas.toBlob() is asynchronous. If the export is cancelled between canvas creation and the callback firing, the finally block resets canvas.width/height to 0 while toBlob may still be reading pixel data — potentially producing a corrupted or empty blob.
File: src/shared/utils/exportRaster.ts
Cancelling an export produces no output. The canvas is only reset after toBlob has fully resolved.
Canvas dimensions are reset while toBlob may still be executing, risking a torn blob.
The exportState.cancelled check inside the toBlob callback fires after the canvas is already reset. Canvas reset should only happen after the toBlob callback has fully resolved.
Safari on iOS and macOS — most sensitive to canvas memory pressure and race conditions.