Skip to content

V2/save location - #9

Open
marcelgundermann wants to merge 3 commits into
v2/scaffoldfrom
v2/save-location
Open

marcelgundermann wants to merge 3 commits into
v2/scaffoldfrom
v2/save-location

Conversation

@marcelgundermann

Copy link
Copy Markdown
Owner

No description provided.

marcelgundermann and others added 3 commits October 29, 2026 15:44
SwDownloadSink (the coordinator's end) moves next to createPortStream (the
service worker's end). It only needs MessagePort, so it compiles under both
tsconfigs, and the test now pairs the real producer with the real consumer
over a MessageChannel instead of a hand-written copy of the producer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RunningJob now asks the location for an output per file instead of switching
on kinds in sinkFor and deliver. Each output carries its sink descriptor and
transferables, what to do once the sink is open, how to finish, and what to
release on failure; the SW download and OPFS staging kinds own their state.

- A failure in any of those steps fails the file as save-failed and stops
  the job. A missing service worker no longer hangs it, and run() catches
  everything, so `done` never rejects.
- The encrypt header write now honours cancel; before, a download that
  never granted credit could not be cancelled.
- OPFS staging holds a Web Lock per staged file until its download has had
  time to finish, and sweeps unlocked files before staging. clearStagingArea,
  which nothing called, is gone.
- SaveTarget is now SaveLocation, matching the glossary; FileOutput moves
  with it, and the OPFS sink reports 'saved' like the others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chooseSaveLocation runs straight from the click: it picks the kind for this
browser and file count, shows the save or folder picker if there is one,
and returns a SaveLocation or why not (dismissed, needs-gesture,
unsupported, save-failed). It never throws, and it only picks OPFS staging
once getDirectory() actually opens, which WebKit's private sessions refuse.
whereToSave says beforehand whether Start will ask where to save.

- The cards call chooseSaveLocation and startJob themselves; pickAndStart
  and asksWhereToSave are gone. Both cards now show save-failed.
- chooseSink, detectCapabilities, sizeLimit, SIZE_LIMITS and outputName
  leave the public interface; preflight works out the save path itself.
- The choice is tested through an internal seam with a fake browser:
  kinds, the picker error mapping, the gesture rule, and refused OPFS.
- The bench uses outputName and OPFS_STAGING_DIR instead of copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
encryptee Error Error Oct 29, 2026 2:57pm UTC

This branch had an error being deployed

1 failed deployment
Preview — 29d81de0 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant