- Add callback to update connection data #88
connInfo
andchanInfo
for join/leave events by @hetao29 #84
- Relax Protobuf dependency requirements to be
>=2.0.0 <4.0.0
instead of^3.0.0
- Fix websocket usage in web env (fixes
The method 'sendByteBuffer' isn't defined for the type 'WebSocket'
error), add simple web example #85
- Update protobuf dependency from
^2.0.0
to^3.0.0
. Requires Dart 2.19
Breaking change! This release changes the semantics of working with connection tokens described in Centrifugo v5 release post.
Previously, returning an empty token string from getToken
callback resulted in client disconnection with unauthorized reason.
Now returning an empty string from getToken
is a valid scenario which won't result into disconnect on the client side. It's still possible to disconnect client by throwing a special UnauthorizedException
from getToken
function.
And we are putting back setToken
method to the SDK – so it's now possible to reset the token to be empty upon user logout.
- Improving reconnect behaviour upon bad network conditions (like connect timeout), #79
- #79 also handles ClientDisconnectedError in _onPing method, addresses #76
- Add support for web platform – #73
- Fix setting initial connection token
- Fix setting connection data
- Fix LateInitializationError if transport is not initialized yet
- Better string representation of
UnsubscribedEvent
Breaking changes
This release adopts a new iteration of Centrifugal protocol and a new iteration of API. Client now behaves according to the client SDK API specification. The work has been done according to Centrifugo v4 roadmap.
Check out Centrifugo v4 release post that covers the reasoning behind changes.
All the current core features of Centrifugal client protocol are now supported here.
New release only works with Centrifugo >= v4.0.0 and Centrifuge >= 0.25.0. See Centrifugo v4 migration guide for details about the changes in the ecosystem.
Note, that Centrifugo v4 supports clients working over the previous protocol iteration, so you can update Centrifugo to v4 without any changes on the client side (but you need to turn on use_client_protocol_v1_by_default
option in the configuration of Centrifugo, see Centrifugo v4 migration guide for details).
Version 0.8.0 is the next iteration of centrifuge-dart
development. It pushes client closer to other clients in the ecosystem. It also contains several backwards incompatible changes.
- Return Futures from
Client.connect
,Client.disconnect
,Subscription.subscribe
,Subscription.unsubscribe
methods - addresses #31. - On initial connect fire
DisconnectEvent
on connection error - this makes behavior ofcentrifuge-dart
similar to all other our clients - addresses #56. - Add client error stream to consume
ErrorEvent
- each transport failure will emit error to this stream - addresses #56. - Refactor subscription statuses - add
subscribing
anderror
statuses. This change is mostly internal should not affect working with Subscriptions. - Do not call
UnsubscribeEvent
if subscription is not successfully subscribed (i.e. insubscribed
state). This makes behavior ofcentrifuge-dart
similar to all other our clients. - Update disconnect reasons due to failed connection and calling
Client.Disconnect
method - make it more similar to all other connector libraries in ecosystem. - Add default transport timeout (10 sec) – on connect and subscribe timeouts client will auto reconnect, calls like publish, history, rpc can now throw
TimeoutException
. Also - properly pass timeout to the transport (was not before!). Again – this makes client behave similarly to all other connectors. - Add
presence
andpresenceStats
methods for Subscription and on client top level (for server-side subscriptions). - Support
streamPosition
inSubscribeSuccessEvent
. - Support
streamPosition
inServerSubscribeEvent
. - Support
data
inServerSubscribeEvent
. - Implement
send
method to send async messages to a server. - Fix deletion during iteration over map when working with server-side subscriptions.
- Better event String representations.
- Improvements and fixes in examples.
- Add support for
data
inSubscribeSuccessEvent
. This is a custom data which can be sent by a server towards client connection in subscribe result. Note that due to the bug in Centrifugo server this feature only works in Centrifugo >= v3.0.3.
Update to work with Centrifuge >= v0.18.0 and Centrifugo v3.
Breaking change in server behavior. Client History API behavior changed in Centrifuge >= v0.18.0 and Centrifugo >= v3.0.0. When using history call it won't return all publications in a stream by default. See Centrifuge v0.18.0 release notes or Centrifugo v3 migration guide for more information and workaround on server-side.
- Protocol definitions updated to the latest version
- History method now accepts optional
limit
,since
andreverse
arguments and returnsHistoryResult
- RPC call now requires method name as first argument (you can pass empty string to mimic previous behavior)
- Publish now returns
PublishResult
- When working with Centrifugo v3 or Centrifuge >= v0.18.0 it's now possible to avoid using
?format=protobuf
in connection URL. Client will negotiate Protobuf protocol with a server using WebSocket subprotocol mechanism (in request headers).
Null safety migration
- library dependencies updated to null safe versions
- library code updated to support null safety in places where required
See issue #47 and pull request #48 for details.
- Skip handling for events from server-side subscriptions resulted in null pointer dereference
- Update protobuf dependency to
^1.0.1
, thanks @Holofox
- Implement
removeSubscription
method, thanks @tiamo
- Breaking changes
connected
property removed
- Breaking changes Changed API to avoid returning futures where they do not make sense – in
connect
andsubscribe
methods. - Client now uses Websocket Ping/Pong frames to find broken connection
- Support for private channel subscription using
onPrivateSub
configuration callback function - Fix several null pointer dereferences in edge cases, throw
ClientDisconnectedError
when there is an attempt to send protocol request over non-connected client. - Fix examples where subscribe could happen before stream handlers set
- Breaking changes Replaced subscribe method with getSubscription in Client.
- Added reconnection.
- Added history method to Subscription. Thanks vanelizarov.
- Added rpc method.
- Added authorization with JWT
- Added subscription to private channel with JWT
- Initial release