Commit Graph
5 Commits
Author SHA1 Message Date
SchluffeandClaude Opus 5.5 ac4d496a48 Version the protocol for 1.0, fail downloads the page abandoned
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>
2026-10-30 15:10:09 +01:00
Schluffe 8f82700736 Refactor the app 2026-10-28 21:05:47 +01:00
SchluffeandClaude Opus 5.5 b6b6e7c29b Lint and format with Biome, and retire used share codes
Biome formats and lints the TypeScript, the Vue templates and the CSS:
pnpm lint checks, pnpm format fixes. It keeps the existing style, single
quotes and 120 columns, and leaves the vendored logo alone. Besides its
recommended rules it looks for promises nobody awaits. Rules that only
flagged deliberate code are off: non-null assertions that state what the
code guarantees, CSS order where no two rules set the same property, and
fieldset for role="group". The one-time formatting pass mostly splits
long chains.

Promises that are deliberately not awaited are marked with void, none of
them can reject today. Buttons say type="button", the any for peer
messages and the checkbox switch keep their reasons in ignore comments.

The sender's code also counts as no longer valid once a transfer started:
that closes the trackers, so another receiver would wait for nothing,
yet the card still offered the code with Copy. The tracker transfer
tests check it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:46:33 +02:00
SchluffeandClaude Opus 5.5 2abd0b504d Own each transfer in a session and harden the protocol
Every operation (share, receive, manual offer or answer) now runs as one
session tied to an AbortSignal. Starting another ends it: its connections,
tracker sockets and timers close, and it can no longer touch the shared
security check, progress or incoming file. Finished, failed and cancelled
transfers close their connections, and the sender's tracker sockets close
once the download starts.

- A malformed or never-connecting tracker offer no longer blocks a share
- The receiver validates the file offer and rejects excess bytes and
  data beyond the flow control window; sw.js checks name and size too
- Failures show up in the card instead of disappearing into rejected
  promises: bad manual codes, unreachable trackers, lost connections
- Primary buttons and pink text meet 4.5:1 contrast, the STUN switch
  shows keyboard focus again, the tracker Copy button matches the others
- Split the core into src/core.ts, src/main.ts only mounts the app, which
  removes the main.ts <-> App.vue import cycle
- Bring back the Gitea source link, write the README
- Tests reuse one browser per worker with fresh contexts, fail on page
  errors, check cleanup after transfers, use a local fake STUN server
  and cover empty files, window boundaries, odd names, malformed
  messages, session replacement and the production build

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 16:04:14 +02:00
Schluffe 1bfeb9843a add missing ws.js and introduce save check for both sides 2026-10-22 23:29:55 +02:00