- Require Dart 3.4
- Switch to using
package:lints
. - Address a few analysis hint violations.
- Populate the pubspec
repository
field.
- Fix a bug where a
null
result to a request caused an exception.
- Migrate to null safety.
- Accept responses even if the server converts the ID to a String.
- Fix
Peer.close()
throwingBad state: Future already completed
.
- Fix
Peer
requests not terminating when the underlying channel is closed.
- Added
strictProtocolChecks
named parameter toServer
andPeer
constructors. Setting this parameter to false will result in the server not rejecting requests missing thejsonrpc
parameter.
- Fixed issue where throwing
RpcException.methodNotFound
in an asynchronous fallback handler would not result in the next fallback being executed. - Updated minimum SDK to Dart
2.2.0
.
Server
and related classes can now take anonUnhandledError
callback to notify callers of unhandled exceptions.
- Allow
stream_channel
version 2.x
- Updated SDK version to 2.0.0-dev.17.0
- When a
Client
is closed before a request completes, the error sent to that request'sFuture
now includes the request method to aid in debugging.
- Internal changes only.
- Internal changes only.
-
Client.sendRequest()
now throws aStateError
if the client is closed while the request is in-flight. This avoids danglingFuture
s that will never be completed. -
Both
Client.sendRequest()
andClient.sendNotification()
now throwStateError
s if they're called after the client is closed.
- Fix new strong-mode warnings.
- Fix all strong-mode warnings.
- Fix a race condition in which a
StateError
could be top-leveled ifPeer.close()
was called before the underlying channel closed.
-
Breaking change: all constructors now take a
StreamChannel
rather than aStream
/StreamSink
pair. -
Client.sendRequest()
andClient.sendNotification()
no longer throwStateError
s after the connection has been closed but beforeClient.close()
has been called. -
The various
close()
methods may now be called before their correspondinglisten()
methods. -
The various
close()
methods now wait on the result of closing the underlyingStreamSink
. Be aware that in some circumstancesStreamController
s'Sink.close()
futures may never complete.
-
Add
Client.isClosed
andServer.isClosed
, which make it possible to synchronously determine whether the connection is open. In particular, this makes it possible to reliably tell whether it's safe to callClient.sendRequest
. -
Fix a race condition in
Server
where aStateError
could be thrown if the connection was closed in the middle of handling a request. -
Improve stack traces for error responses.
- Update the README to match the current API.
- Add a
done
getter toClient
,Server
, andPeer
.
-
Add a
Client
class for communicating with external JSON-RPC 2.0 servers. -
Add a
Peer
class that's both aClient
and aServer
.
-
Remove
Server.handleRequest()
andServer.parseRequest()
. Instead,new Server()
takes aStream
and aStreamSink
and uses those behind-the-scenes for its communication. -
Add
Server.listen()
, which causes the server to begin listening to the underlying request stream. -
Add
Server.close()
, which closes the underlying request stream and response sink.
- Widen the version constraint for
stack_trace
.
- Fix error response to include data from
RpcException
when not a map.