# X_SUBSCRIPTION_ID_TAKEN

## Means

a subscribe frame reused a `sid` this socket already holds

## Typical cause

a hand-rolled client incrementing its own subscription ids, or a remount that reuses one. Subscriptions are keyed by `(socket, sid)`, so a reused id would otherwise orphan the earlier subscription — its entry never reaching zero subscribers and never being freed

## Fix

send a fresh sid with each subscribe frame — `crypto.randomUUID()` is what the bundled client uses

[Realtime](/error-codes#realtime)
