v0.1.6
What's changed
A single fix, for a bug that made one of the most-used subscriptions unusable.
allMids() never resolved
client.allMids() — with no arguments, or with dex: "" — never resolved. It rejected with WebSocketRequestError: Request timed out after the configured timeout, or hung forever when timeout was null. Only a non-empty dex worked, so the main-dex mid-price feed was unusable.
The chain:
allMidsbuilds its payload as{ type: "allMids", dex: params.dex || undefined }, sodexexists as an own key holdingundefined.- The request normalizer walks
Object.keys()and faithfully recreates that key, so the subscription's normalized form carriesdex: undefined. JSON.stringifydrops it on the way out — the server receives{"type":"allMids"}and echoes back exactly that.- Echo matching requires every key of the pending request to be present in the response. It looks for a
dexthe server was never told about, finds nothing, and the subscription is never matched to its own confirmation.
Fixed in the normalizer rather than in allMids: a key whose value is undefined cannot survive serialization, so keeping it leaves the in-memory identity describing a request that was never sent. Dropping it makes the id, the echo and the wire frame agree, and immunizes any future payload built with the same x || undefined shape.
Note on coverage
No test caught this because the only allMids test needs the live network and is skipped in the offline suite. The regression test added here covers the root cause and runs offline. If you subscribe to allMids, upgrading from 0.1.5 is the difference between the channel working and not.