[Windows] Saving a generated image via context menu throws `setProgressBar is not a function`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
On the current Windows stable ChatGPT/Codex desktop build, saving a generated chat image through the native context menu (right-click image → Save Image As…) raises an uncaught exception in the main process:
Uncaught Exception:
TypeError: h.setProgressBar is not a function
at DownloadItem.<anonymous> (...app.asar:289166)
at DownloadItem.emit (node:events:508:28)
This started after updating to the unified ChatGPT desktop app.
Environment
- Windows package:
OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0 - App package metadata version:
26.820.60940 - Build number:
7119 - Runtime: Owl
- Electron dependency:
42.3.0 - OS: Windows 11 x64, version
10.0.26200
The official production update manifest currently also reports 26.820.7780.0 as the stable build.
Steps to reproduce
- Open the Windows ChatGPT desktop app.
- Open a chat containing a generated image.
- Right-click the image.
- Select Save Image As….
- Choose a destination and let the download complete.
Actual behavior
A modal titled “A JavaScript error occurred in the main process” appears with TypeError: h.setProgressBar is not a function.
Expected behavior
The image should save without a main-process exception.
Root cause found in the shipped bundle
The native image context menu is installed by the app through electron-context-menu (4.1.2), whose bundled download path uses electron-dl.
In the download updated handler, the progress call is guarded only by showProgressBar:
if (!window_.isDestroyed() && options.showProgressBar) {
window_.setProgressBar(progressDownloadItems());
}
In the download done handler, clearing the progress bar is unconditional whenever no downloads remain:
if (!window_.isDestroyed() && !activeDownloadItems()) {
window_.setProgressBar(-1);
receivedBytes = 0;
completedBytes = 0;
totalBytes = 0;
}
The Owl-backed window returned by BrowserWindow.fromWebContents(webContents) does not expose setProgressBar, so the completion handler throws.
The app's own installNativeContextMenu prepends the affected saveImageAs action for images, which makes this reproducible from generated-image context menus.
Suggested fix
Either implement BrowserWindow.setProgressBar in the Owl Electron compatibility layer, or capability-check it at both call sites:
if (
!window_.isDestroyed()
&& typeof window_.setProgressBar === 'function'
&& options.showProgressBar
) {
window_.setProgressBar(progressDownloadItems());
}
if (!window_.isDestroyed() && !activeDownloadItems()) {
if (typeof window_.setProgressBar === 'function') {
window_.setProgressBar(-1);
}
receivedBytes = 0;
completedBytes = 0;
totalBytes = 0;
}
Workaround
Using the image's in-page download control, or Copy Image followed by saving the clipboard bitmap, avoids the failing native context-menu path.
Contributor 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.
Research direction
Locate the app's installNativeContextMenu entry point and the electron-context-menu/electron-dl download handlers described in the issue. Reproduce Save Image As on Windows, then verify that downloads complete without an exception when the Owl window lacks setProgressBar, using the existing workaround paths for comparison.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, javascript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100