3.5 KiB
Handoff: issue #20 (save writes a 0-byte file)
Written 2026-11-23. Read OVERVIEW.md first for the app itself. This file covers only the open problem.
The problem
Issue #20 (#20), a follow-up to #19 (?reset=1).
After unlocking, adding #reset=1 and erasing the secrets, the Save button (Chrome) creates a 0-byte file. The status line shows:
Save failed: Failed to execute 'createWritable' on 'FileSystemFileHandle': The request is not allowed by the user agent or the platform in the current context.
What is established
- It is not caused by reset. Save after reset uses the same
save()path as any edit (src/app.js,async function save). The user has not yet tried a plain save without#reset=1on the SSD. - The picker succeeds and Chrome creates the empty file. Then
state.handle.createWritable()throwsNotAllowedError. Nothing is written. - Headless Chrome with a stubbed
showSaveFilePicker(OPFS) wrote a full file, so assemble/encrypt is fine. A real picker can't be driven headless. - The user says saving to a thumbdrive works fine, while every SSD location tried fails. This contradicts the theory that Chrome blocks the
file://site as a whole (chrome://settings/content/filesystem). Treat that theory as unlikely.
What was changed (commit 613f039, not pushed)
save() now catches NotAllowedError/SecurityError on the write, clears state.handle, downloads final-wishes.html as a fallback and sets an explanatory status. docs/MAINTENANCE.md has a matching line. Tests pass (63 pass, 1 skipped). This is a workaround, not a diagnosis. Issue #20 is still open.
Also committed this session: c480ff1 (OVERVIEW.md refresh for ?reset=1). Neither commit is pushed.
Open hypotheses (why the SSD fails and the thumbdrive works)
- Overwriting an existing file (thumbdrive, probably) versus creating a new one (SSD).
- Real filesystem permissions: a folder the user doesn't own, or a read-only or odd mount. Chrome can report OS "permission denied" as this same
NotAllowedError. - Chrome's blocked-folder list on Linux (home folder itself, system or config folders).
Next steps
- Ask the user for the exact SSD path tried, and whether it was a new filename or an existing file. Check ownership and mount options (
ls -ld,findmnt,stat). - Have the user try a new filename on the thumbdrive. If that fails too, the problem is creating new files, not the location.
- Have the user try a plain save (no reset) on the SSD, and check the DevTools console.
- If the cause stays unclear, add a small diagnostic that shows the exact error name and
location.hrefin the status line. - Fallback the user may prefer: always download instead of saving in place. A download is Chrome writing the file, so it is allowed by default. The cost is that the old file is not overwritten.
- The user must rebuild and carry their data across to get the fallback. A saved file keeps the code it was saved with. Run
npm run build(done,dist/final-wishes.html), then use "Open your existing Final Wishes file" on the start screen.
Housekeeping
- Issue tooling:
gtis not installed. Usetea(tea issues create,tea comment N "..."). - Scratch files from this session are in the session scratchpad:
d.json(plaintext test data),fw.htmlandt.mjs(the CDP test script). Deleted.jsonwhen done. None are in the repo. - Close #20 only after the user confirms a real Chrome save works or the download fallback behaves.