Releases: SocketCluster/socketcluster-client
v8.0.1
v8.0.0
Added subscription batching - This allows the client to subscribe to multiple channels using a single WebSocket frame for a performance boost.
Breaking change:
Bug fix: the 'raw' event argument will now always be a string. There was an issue in older versions where a JSON string would be cast to an object.
v7.0.2
v7.0.1
v7.0.0
socket.authState
can no longer be in a 'pending'
(socket.PENDING
) state.
The 'pending'
authState
represented the ambiguous authentication state which might occur when the socket is disconnected/offline. It was removed because it was too ambiguous to be useful. Instead, socket.authState
now reports the last known authentication status (optimistic approach).
Once a socket is authenticated with a valid JWT, the socket will now report itself as being 'authenticated'
until the server explicitly indicates otherwise (e.g. the server invalidates the token).
Note that this only affects the authState
property and the events related to it. Pub/sub channels are not affected; the 'pending'
state
is still supported for SCChannel
objects (the meaning of 'pending'
is a lot clearer in that context).
Breaking changes:
- Front-end authentication logic which makes explicit comparisons between
socket.authState
and'pending'
orsocket.PENDING
may need to be reworked to deal with only two states:'unauthenticated'
(socket.UNAUTHENTICATED
) and'authenticated'
(socket.AUTHENTICATED
). - Front-end authentication logic which listens for the
'authStateChange'
event may be affected since there are now only two possible auth states instead of three.
v6.4.0
v6.3.0
v6.2.2
v6.2.0
- You can now optionally assign a
priority
to each channel - This will determine the order in which subscriptions are sent to the server - This includes auto-resubscription when the socket recovers from a connection failure. The priority must be a number; the higher the priority, the sooner the subscription will be processed. So if you havesocket.subscribe('bar').priority = 2;
andsocket.subscribe('foo').priority = 3;
then the subscriptions will be sent to the server in the order# 1:foo
,# 2:bar
. - Fixed a bug which meant that pending channel subscriptions would always be processed just before triggering the 'connection' event; even when
autoProcessSubscriptions / autoSubscribeOnConnect
was set tofalse
. Note that if you aren't using theautoProcessSubscriptions / autoSubscribeOnConnect
option, then this bug will not affect you. If you do useautoProcessSubscriptions / autoSubscribeOnConnect
, then this bug may also not affect you (but this strictly depends on your specific use case).
Breaking change:
autoProcessSubscriptions
option has been renamed toautoSubscribeOnConnect
.