PROTOCOL (hellcon/1) goes in front of the PBKDF2 salt and names the data channel, so different versions never meet via a tracker and the manual receiver tells a sender on another protocol apart. The footer shows it, the receiver's hints ask to compare it. Forks are asked to name their own. public/sw.js and the page exchange a VERSION, a mismatch fails the download with outdated. The worker fails a download after 20 s without a chunk or ping from its page, else Firefox saves the truncated file of a closed tab as complete. The build uses relative links and works under any path. On https only wss: trackers and ws: to this device are accepted, one the browser refuses to open counts as lost. Also: a file read short stops the transfer, an offer waiting on a lost tracker isn't answered, a share ended while its key was derived opens no tracker, and tracker and receiver errors lose hidden characters. The README lists what isn't planned and the phone limitation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
3.1 KiB
Markdown
48 lines
3.1 KiB
Markdown
# TODO
|
|
|
|
## Ideas
|
|
|
|
- Resume interrupted transfers: the receiver already reports how much the download manager has
|
|
read (`{ read }`), which is where a new connection could continue. The browser can't append to a
|
|
finished or failed download though, so a resume would have to start a new one.
|
|
|
|
- Keep user settings again: for now every reload starts from the defaults, the server lists and the
|
|
own salt too. Open which ones to keep, and how a kept one that differs from the other side's would
|
|
show, instead of silently breaking a share.
|
|
|
|
- Revisit the screen wake lock: a browser that keeps refusing it (e.g. in a power saving mode) logs
|
|
"screen may lock" each time the page is visible again, open whether once per session is enough.
|
|
`awake: …` doesn't cover a session that ends in an error, nor one that ends while a request is
|
|
still pending, the case the `wakeLock === request` checks in `holdWakeLock` are for.
|
|
|
|
## Open observations
|
|
|
|
- A phone can't send in the background: with Brave on Android (Pixel), the connection is lost as
|
|
soon as the sender's page goes to the background. Receiving survives it, likely because the
|
|
browser's download manager runs as a foreground service while the file streams into it. The wake
|
|
lock only keeps the screen from timing out, the sender's page has to stay in front.
|
|
|
|
- Firefox ignores an errored service worker response stream: when the sender vanishes, the receiver
|
|
logs "download failed: connection lost", but the download stays "in progress" until the user
|
|
cancels it. Closing the stream instead is worse, Firefox then reports the truncated file as
|
|
complete despite `Content-Length`. Chromium fails the download, but only once the connection
|
|
counts as failed (~16 s), because its data channel never fires `close` for a vanished peer.
|
|
|
|
- Firefox also saves a truncated file as complete when it stops the service worker in the middle of
|
|
a download (after 30 s without events). The receiver's pings (`KEEPALIVE`) prevent that, covered by
|
|
`large: firefox survives a 40 s stall`. A browser that stops it anyway would still never show
|
|
"download complete" or "delivered", only its download manager would be wrong.
|
|
|
|
- `large: firefox sends 2.5 GiB` hit the 5 minute timeout once (first run after the normal suite),
|
|
not reproduced in 3 runs since. The report was lost; the attached logs will show the cause if it
|
|
happens again.
|
|
|
|
- Small downloads (empty, one byte) were sometimes never saved, though the worker reported them
|
|
finished and both sides logged success: the browser can read the whole response before it hands
|
|
the navigation to its download manager, and removing the frame before that cancels it. Without a
|
|
delay `boundary: … sends an empty file` failed 8 of 10 runs, the one byte file 4 of 10. The
|
|
workaround `DOWNLOAD_GRACE` keeps the download's frame 1 s after finished. No event tells when the
|
|
browser took the download, so the 1 s is empirical: `boundary: … keeps a finished download's frame
|
|
for DOWNLOAD_GRACE` covers the retention, not the browser's timing. A small download that goes
|
|
missing again means it's too short.
|