[Bug] A failing export hangs the dialog forever instead of showing the error #708

Closed
opened 2026-07-22 23:04:34 +00:00 by brenno · 0 comments
Owner

Found from a user report — "hij hangt gewoon" (it just hangs) — during an export. The app sat at 0% CPU, sleeping: not rendering, waiting on something that never came.

Root cause. _ExportDialogState._export() in lib/widgets/dialogs/export_dialog.dart had no error handling at all (no try/catch anywhere in the file). The method sets _loading = true, then calls SlideRasterizer.rasterize(...) and exportService.export(...). If either throws — a SlideRasterizerNoFrameException frame-timeout, a write error, a fault in the PDF/PPTX assembly — the exception propagates out uncaught and the line that sets _loading = false is never reached. The dialog stays on its "…samenstellen…" / "rendering…" phase text forever, with no message.

The existing error path only covers a returned ExportResult(success: false). A thrown exception bypasses the result object entirely.

Reproduce (deterministic). Inject an ExportService whose export() throws and export as HTML (HTML skips the rasterizer, so the throw lands straight in the dialog). The dialog freezes on the building-phase text; no error, no way forward but to close the window.

Fix. Wrap the render+export body in try/catch; on a caught exception, log it with its stack, clear _loading, and show the error (with the exception detail on its own line, since "export failed" alone leaves the user with nothing). Regression test drives the throwing-service path.

Filed and fixed in the same session; PR closes this.

Found from a user report — "hij hangt gewoon" (it just hangs) — during an export. The app sat at 0% CPU, sleeping: not rendering, waiting on something that never came. **Root cause.** `_ExportDialogState._export()` in `lib/widgets/dialogs/export_dialog.dart` had **no error handling at all** (no `try/catch` anywhere in the file). The method sets `_loading = true`, then calls `SlideRasterizer.rasterize(...)` and `exportService.export(...)`. If either throws — a `SlideRasterizerNoFrameException` frame-timeout, a write error, a fault in the PDF/PPTX assembly — the exception propagates out uncaught and the line that sets `_loading = false` is never reached. The dialog stays on its "…samenstellen…" / "rendering…" phase text forever, with no message. The existing error path only covers a *returned* `ExportResult(success: false)`. A *thrown* exception bypasses the result object entirely. **Reproduce (deterministic).** Inject an `ExportService` whose `export()` throws and export as HTML (HTML skips the rasterizer, so the throw lands straight in the dialog). The dialog freezes on the building-phase text; no error, no way forward but to close the window. **Fix.** Wrap the render+export body in `try/catch`; on a caught exception, log it with its stack, clear `_loading`, and show the error (with the exception detail on its own line, since "export failed" alone leaves the user with nothing). Regression test drives the throwing-service path. Filed and fixed in the same session; PR closes this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
LibreKAT/Ocideck#708
No description provided.