[Windows app] Save As dialog waits for the entire generated file to download
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
App version, subscription, and platform
Microsoft Store package OpenAI.Codex 26.901.6511.0, application 26.901.51231; Pro 20×; Windows 11 x64.
Issue and reproduction
Click Save As on a generated ZIP or another large attachment. The file control becomes disabled, but the destination dialog may not appear for tens of seconds or about a minute. It eventually succeeds.
Root cause in the distributed client
The renderer's jNn awaits the entire download Blob, converts the complete file to an ArrayBuffer / Uint8Array, and then invokes workspaceFiles.saveCopy. The host opens its native save dialog only after that call arrives. Network retrieval therefore happens before the first destination prompt.
A deterministic test uses a delayed Blob promise and records dialog calls: the original native handler never opens the dialog until the promise resolves. This differs from #41546, which reports newly generated attachments failing until they become available.
Local repair
The save dialog is requested first. After the user chooses a destination, the existing download function runs. Cancelling the dialog avoids the download. The renderer transfers at most 8 MiB per chunk instead of building another full-file cross-process byte array. Network retrieval still uses the existing Blob path; this does not claim faster network throughput.
A time-limited, service-instance-scoped save reservation writes a sibling temporary file, verifies chunk order and total length, and atomically replaces the chosen destination after completion. Existing files survive network or write failures, cancellation, or external changes detected while waiting. Legacy save and preview paths remain supported. The control gains a spinner and accessible busy text.
Validation
Sixteen filesystem/transfer cases and eight native handler/control cases cover dialog ordering, cancel-before-download, partial writes, byte equality, replay/isolation, expiry, disposal, limits, destination changes, and write/rename failures. The user confirmed successful saving in the actual client.
Entry points: assets/local-save-download-v1.mjs, assets/local-deferred-save-copy.cjs, tests/deferred-save.mjs, and tests/download-native.mjs.
Reproducible repair
Complete English implementation, English release, and focused findings. The original project is wjtianze/codex-desktop-repair, with Chinese documentation on main. A star is appreciated if these repairs or reproductions are useful.
Both language editions passed 287 cases: 105 portable and 182 cases using functions extracted from the exact official installation. The public package contains patch fragments, independent helpers, tests, and documentation, not complete client bundles or account data. This is an evidence submission and local repair, not an upstream source merge.
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
Start by reading assets/local-save-download-v1.mjs and assets/local-deferred-save-copy.cjs, then run tests/deferred-save.mjs and tests/download-native.mjs to understand the reported dialog ordering and transfer cases. Done means the native dialog opens before downloading, cancellation avoids the download, and the listed filesystem and native-handler tests pass without altering legacy paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100