Skip to content

Commit

Permalink
Release 3.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
EnzoViry1 authored Jan 7, 2025
2 parents 24ea238 + 3261280 commit ceaa98f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/actions/doc-snippets/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ runs:
using: "composite"
steps:
- name: Run Doc snippets Tests
run: docker-compose -f .ci/doc/docker-compose.yml run doc-tests index
run: docker compose -f .ci/doc/docker-compose.yml run doc-tests index
shell: bash
2 changes: 1 addition & 1 deletion .travis.old.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
if: type = pull_request OR type = push AND branch =~ /^master|[0-9]+-dev$/ OR type = cron
language: node_js
node_js: 12
script: docker-compose -f .ci/doc/docker-compose.yml run doc-tests index
script: docker compose -f .ci/doc/docker-compose.yml run doc-tests index


- stage: Tests
Expand Down
2 changes: 1 addition & 1 deletion docker_launch.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
sysctl -w vm.max_map_count=262144
docker-compose up -d
docker compose up -d
until curl "http://localhost:7512/?pretty"; do sleep 10; done
./adminauth.sh
dart pub get
2 changes: 1 addition & 1 deletion lib/src/kuzzle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class Kuzzle extends KuzzleEventEmitter {
startQueuing();
}

emit(ProtocolEvents.NETWORK_ERROR, [error]);
emit(KuzzleEvents.NETWORK_ERROR, [error]);
});

protocol.on(ProtocolEvents.DISCONNECT, () {
Expand Down
1 change: 1 addition & 0 deletions lib/src/kuzzle/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ class KuzzleEvents {
static const String RECONNECTED = 'reconnected';
static const String DISCONNECTED = 'disconnected';
static const String QUERY_ERROR = 'queryError';
static const String NETWORK_ERROR = 'networkError';
}
23 changes: 10 additions & 13 deletions lib/src/protocols/websocket_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'dart:html';

import 'package:kuzzle/src/kuzzle/response.dart';

import '../kuzzle/errors.dart';
import '../kuzzle/request.dart';

import 'abstract.dart';
Expand All @@ -24,6 +23,8 @@ class KuzzleWebSocket extends KuzzleProtocol {

WebSocket? _webSocket;
StreamSubscription? _subscription;
StreamSubscription? _onErrorSubscription;
StreamSubscription? _onCloseSubscription;
Duration pingInterval;
Timer? pingTimer;

Expand Down Expand Up @@ -52,21 +53,11 @@ class KuzzleWebSocket extends KuzzleProtocol {
}
});

final onErrorSubscription =
_webSocket!.onError.listen(_connected.completeError);
_onErrorSubscription = _webSocket!.onError.listen(_handleError);

final onCloseSubscription = _webSocket!.onClose.listen((Event event) {
_connected
.completeError(KuzzleError('Unable to connect to ${uri.toString()}'));
});
_onCloseSubscription = _webSocket!.onClose.listen(_handleDone);

_webSocket!.onOpen.listen((_) {
onErrorSubscription.cancel();
onCloseSubscription.cancel();

_webSocket!.onError.listen(_handleError);
_webSocket!.onClose.listen(_handleDone);

_connected.complete();
});

Expand All @@ -91,6 +82,12 @@ class KuzzleWebSocket extends KuzzleProtocol {

_webSocket?.close();
_webSocket = null;

_onErrorSubscription?.cancel();
_onErrorSubscription = null;

_onCloseSubscription?.cancel();
_onCloseSubscription = null;
}

void _handlePayload(MessageEvent payload) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: kuzzle
version: 3.0.4
version: 3.0.5
description: A library to interact with kuzzle API. A backend software,
self-hostable and ready to use to power modern cross-platform apps.
homepage: https://github.com/kuzzleio/sdk-dart
Expand Down

0 comments on commit ceaa98f

Please sign in to comment.