Skip to content

Commit

Permalink
fix client connection behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
Skycoder42 committed Mar 24, 2024
1 parent f489586 commit 502a84f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 29 deletions.
5 changes: 5 additions & 0 deletions serverpod_json_rpc_2_client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1] - 2024-03-24
### Fixed
- Do not require the client to be in the connected state

## [1.0.0] - 2024-03-23
### Changed
- Initial release

[1.0.1]: https://github.com/Skycoder42/serverpod_json_rpc_2/compare/serverpod_json_rpc_2_client-v1.0.0...serverpod_json_rpc_2_client-v1.0.1
[1.0.0]: https://github.com/Skycoder42/serverpod_json_rpc_2/releases/tag/serverpod_json_rpc_2_client-v1.0.0
1 change: 0 additions & 1 deletion serverpod_json_rpc_2_client/lib/module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ export 'package:serverpod_client/serverpod_client.dart';

export 'src/channels/endpoint_rpc.dart';
export 'src/channels/endpoint_stream_channel.dart';
export 'src/channels/invalid_streaming_status_exception.dart';

export 'src/protocol/protocol.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import 'dart:async';
import 'package:serverpod_client/serverpod_client.dart';
import 'package:stream_channel/stream_channel.dart';

import 'invalid_streaming_status_exception.dart';

/// An extensions for generic [EndpointRef]s that allows to access the endpoints
/// websocket connection via a [StreamChannel].
///
Expand All @@ -23,6 +21,9 @@ import 'invalid_streaming_status_exception.dart';
/// [StreamChannel.stream], but it will **not** close the websocket connection!
/// This is because multiple endpoints could be using the same connection. If
/// you need to close the connection, use
/// 4. It is allowed to call [createStreamChannel] before
/// [ServerpodClientShared.openStreamingConnection]. However, in that case you
/// **must not** add any messages to the [StreamChannel.sink] before doing so.
/// [ServerpodClientShared.closeStreamingConnection]. Please note that closing
/// the *sink* will **not** notify the server at all. Further messages received
/// from the server will be silently dropped.
Expand All @@ -32,16 +33,7 @@ extension EndpointStreamChannel on EndpointRef {
/// If a previous channel already exists it will be closed, meaning the
/// [StreamChannel.stream] will emit the done event and adding more messages
/// to the[StreamChannel.sink] will have no effect.
///
/// If the [ServerpodClientShared.streamingConnectionStatus] is not
/// [StreamingConnectionStatus.connected], this method will throw a
/// [InvalidStreamingStatusException].
StreamChannel<SerializableEntity> createStreamChannel() {
if (client.streamingConnectionStatus !=
StreamingConnectionStatus.connected) {
throw InvalidStreamingStatusException(client.streamingConnectionStatus);
}

resetStream();

final controller = StreamChannelController<SerializableEntity>(
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion serverpod_json_rpc_2_client/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: serverpod_json_rpc_2_client
description: The client package for the serverpod_json_rpc_2 module for JSON RPC 2.0.
version: 1.0.0
version: 1.0.1
homepage: https://github.com/Skycoder42/serverpod_json_rpc_2

environment:
Expand Down

0 comments on commit 502a84f

Please sign in to comment.