Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into develop/1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ikulikov committed Dec 13, 2023
2 parents 3875624 + a0926d0 commit 15b3dd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.0.9

- Update API and models according to ThingsBoard platform version 3.6.2
- Fixed issue [#13](https://github.com/thingsboard/dart_thingsboard_client/issues/13): Problem occurred when using web socket and loosing internet
- Fixed issue [#19](https://github.com/thingsboard/dart_thingsboard_client/issues/19): incorrect AlarmDataCmd
- Fixed issue [#21](https://github.com/thingsboard/dart_thingsboard_client/issues/21): incorrect updated notification in subscription

Expand Down
6 changes: 5 additions & 1 deletion lib/src/service/telemetry_websocket_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,19 @@ class TelemetryWebsocketService implements TelemetryService {
try {
var channel = WebSocketChannel.connect(_telemetryUri);
_sink = channel.sink;
channel.ready.then((value) => _onOpen(token), onError: ((e, stackTrace) {
_onError(e);
_onClose(channel);
}));
channel.stream.listen((event) {
_onMessage(event);
}, onDone: () {
_onClose(channel);
}, onError: (e) {
_onError(e);
});
_onOpen(token);
} catch (e) {
_onError(e);
_onClose();
}
}
Expand Down

0 comments on commit 15b3dd6

Please sign in to comment.