useRefreshSubscriptions
Re-issue every live subscription after the connection's subject changes — no reload, no reconnect.
When a user signs in, the server rebinds the subject on the existing connection. Every open subscription is now snapshotting against the wrong subject's tenant scope. Reloading the page would fix it and lose everything else; this hook is the surgical version.
import { useRefreshSubscriptions } from '@voltro/client'
const refresh = useRefreshSubscriptions('app')
await signIn(...)
refresh()It returns a stable zero-argument function. Calling it interrupts each active subscription's fiber and re-forks it over the same WebSocket — no reconnect. Server-side each one is a fresh subscription, so it flows through the auth middleware again and resolves the new subject.
Optimistic patches survive the refresh: they are tied to mutation lifecycles, not subscription lifecycles, and the new snapshots land underneath them.
This is not a cache-invalidation tool. Subscriptions are already live, so a normal write needs no refresh — reach for this only when the connection's identity changed underneath them.