From 28c845e6872f9ee18f1ed9582d4385350eab7baa Mon Sep 17 00:00:00 2001 From: Jumper Chen Date: Mon, 4 Nov 2024 12:25:36 +0800 Subject: [PATCH] Fix #398 [Issue] Unhandled Exception: type 'String' is not a subtype of type 'Iterable' on Server Acknowledgement --- CHANGELOG.md | 5 +++++ lib/src/socket.dart | 5 ++++- pubspec.yaml | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 441789b..1197560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.0.1 + +**Bug fix:** +* [#398](https://github.com/rikulo/socket.io-client-dart/issues/398) [Issue] Unhandled Exception: type 'String' is not a subtype of type 'Iterable' on Server Acknowledgement + ## 3.0.0 **Bug fix:** diff --git a/lib/src/socket.dart b/lib/src/socket.dart index c6e865d..8e6ef36 100644 --- a/lib/src/socket.dart +++ b/lib/src/socket.dart @@ -311,7 +311,10 @@ class Socket extends EventEmitter { acks[sid] = (args) { timer.cancel(); - Function.apply(ack, [null, ...args]); + Function.apply(ack, [ + null, + ...(args is List ? args : [args]) + ]); }; } diff --git a/pubspec.yaml b/pubspec.yaml index b995918..0932bd8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: socket_io_client description: Dartlang port of socket.io-client for web, flutter, dartvm to use -version: 3.0.0 +version: 3.0.1 homepage: https://www.zkoss.org repository: https://github.com/rikulo/socket.io-client-dart issue_tracker: https://github.com/rikulo/socket.io-client-dart/issues @@ -10,7 +10,7 @@ environment: dependencies: logging: '^1.2.0' - socket_io_common: '^3.0.0' + socket_io_common: '^3.0.1' dev_dependencies: lints: ^4.0.0