Version history of src/lib/connection.ts

September 2026

Runtime shape at the read boundaries: what the app stores is validated on the way in, and only there, because the write path is the volume and the scrub and re-checking a value the app built a moment ago would tax frames to guard against a mistake it did not make. What JSON.parse could not see is now caught: a stored host that is no longer the output of normalizeHost, which is the one stored string this app attaches a username and a salted md5 of the password to; a login draft stored as null, which threw while the dialog rendered, on the one screen with no way out of it; a repeat mode the player has never heard of, which matched no comparison and quietly stopped repeats; a cached songCount of "3", which never equals the length of the cache, so the library re-crawled every boot with no symptom anyone could name; and a proxy that answers /rest/ping with its own login page at a 200, which arrived as the JSON parser's TypeError instead of an error naming the endpoint. The song and album rows are deliberately unvalidated — parse() hands back a copy with the undeclared keys dropped, and those rows are identity-keyed by the virtualizer and carry provenance a hand-kept schema would silently lose — and the envelope keeps everything beside status unvalidated, with status wider than ok/failed, so a server that spells it oddly still gets to report its own failure. RepeatMode is read off REPEAT_ORDER, so a fifth mode cannot skip the schema. Costs 1.7kB gzipped on the main chunk, and each guard is covered by tests that fail without it.
2000.nyc
·