Commit Graph

6 Commits

Author SHA1 Message Date
Fabian @ Blax Software e749526ef8 feat(i18n): ship websocket.* translations, ignore echoed keys (0.4.0)
- src/i18n.ts holds the client's own texts (connection lost/restored,
  request timeout/lost) in en de es fr it ja nl pl tr uk, exported as
  `@blax-software/networking/i18n` and registered through the "blax-i18n"
  package.json field, so `blax-i18n build --packages auto` merges them.
- `_t()` treats a translation equal to its key as missing. vue-i18n echoes
  missing keys, so users saw "websocket.connectionrestored" instead of the
  English fallback.
- Tests: echoed key falls back, real translation is used, the shipped
  module covers every `_t()` key in every locale.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 12:07:34 +02:00
Fabian @ Blax Software d0a8f46d80 feat(ws): opt-in send timeout, per call or client-wide (0.3.3)
send() waited forever when the server never answered. In apps that awaited
a read during page setup, a dropped response left the old layout on screen
with an empty body until a reload.

- sendTimeout (ms, default 0 = off): reject unanswered sends with
  { message, code: 'timeout' }. The clock starts at the call, so a send
  stuck behind the connect or channel subscribe times out too.
- send(event, data, channel, { timeout, progress }): per-call override;
  a bare function as 4th argument still means progress. timeout 0 opts out.
- A send that timed out before it was written is dropped from the queue
  instead of going out late after a reconnect.
- Protocol events (websocket.*) never time out.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 14:42:03 +02:00
Fabian @ Blax Software 737954ba2d fix(ws): don't strand sends when a connection attempt fails (0.3.2)
A page's send() queued behind a failing first connect hung forever — the
close handler dropped the ensureConnected() waiter without settling it, and
a throttled connect() was silently skipped, so nothing ever reconnected.
Symptom in apps: sidebar renders, page body stays blank until a reload.

- ensureConnected(): one waiter per outage, resolved by whichever attempt
  succeeds next (no longer orphaned by a failed attempt)
- connect(): a call that lands on the reconnect throttle is retried when the
  window opens instead of being dropped
- a replaced (connect(true)) or destroy()ed socket's late error/close no
  longer wipes the live socket's state or schedules a reconnect
- destroy() cancels a pending auto-reconnect
- new opt-in `rejectOnDisconnect`: a send already written to a socket that
  closes rejects with { message, code: 'connection_lost' } instead of
  hanging (default off — unchanged behaviour for existing consumers)
- node:test suite (`npm test`) with a scripted fake socket covering each case

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 09:46:52 +02:00
Fabian @ Blax Software 1d8f43148f docs(agents): add AGENTS.md client reference, ship it via files[], fix ApiClient method names
- AGENTS.md: canonical client reference — factories + the app `ws` singleton, send()
  (streaming via the 4th progress arg, no-timeout caveat), listen/listenWhileMounted,
  the EventTarget mechanics, the setAppReady() gate, the SSR pattern, and a footgun checklist.
- package.json: add AGENTS.md to files[] so it ships to node_modules in consumer installs.
- README: correct the ApiClient method table — `bearerToken` getter / getBackendUrl() /
  setBearer(null) (getBearer/getServerUrl/clearBearer never existed) + accurate verb signatures.
2026-06-30 10:56:33 +02:00
Fabian @ Blax Software bfb32a8599 docs: add star history section
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 16:44:35 +02:00
Fabian @ Blax Software 1c3c618c27 Init 2026-04-07 08:44:00 +02:00