fix(sdk,transport): bounded prekey requests and a real registration retry (4.13.2)

An unreachable prekey server (packets dropped, not refused) held
createShade for ~2 min per call, and a failed registration was never
retried despite the log saying so. Every request now has a deadline,
registration retries with backoff until it lands, and
registration: 'background' lets an app open its identity offline.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-10-15 20:49:56 +02:00
parent 5d04e18482
commit bcae7b346e
35 changed files with 406 additions and 60 deletions

View File

@@ -5,6 +5,30 @@ All notable changes to Shade are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [4.13.2] — 2026-10-15 — No prekey-server call can hang an identity open
### Fixed
- **`@shade/transport`: every prekey-server request has a deadline**
(`requestTimeoutMs`, default 15 000; `DEFAULT_REQUEST_TIMEOUT_MS` exported).
A server that drops packets instead of refusing them held each call until
the kernel gave up on the TCP handshake — about two minutes on Linux.
Expiry throws a `NetworkError` naming the host.
- **`@shade/sdk`: a failed initial registration is actually retried** — with
backoff (5/15/30/60 s) until it succeeds, the identity rotates or is
restored, or `shutdown()` runs. The old log line promised a retry "on next
replenish", but replenish never registers: an identity that came up while
the server was unreachable stayed unregistered until the next restart.
### Added
- `ShadeConfig.registration: 'await' | 'background'` (default `'await'`, now
bounded by the timeout). `'background'` opens the identity without waiting
on the network — for apps whose unlock must be purely local.
- `ShadeConfig.requestTimeoutMs` and `ShadeConfig.fetch` (also on
`ShadeFetchTransport`): observe reachability, or stub the network in tests.
Found by Prism: with the relay unreachable, unlock — and with it the first
terminal — waited minutes on a register call.
## [4.13.1] — 2026-10-06 — Inbox keeps per-recipient order across retries
### Fixed