diff --git a/CHANGELOG.md b/CHANGELOG.md index 63a7f52b..f4c29fee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.2 +* `_join` previously discarded quer parameters, etc. + # 2.0.1 * Change `BaseAngelClient` constructor to accept `dynamic` instead of `String` for `baseUrl. diff --git a/analysis_options.yaml b/analysis_options.yaml index a146a9e6..64bd1e8f 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,5 +2,5 @@ include: package:pedantic/analysis_options.yaml analyzer: strong-mode: implicit-casts: false - errors: - unawaited_futures: ignore \ No newline at end of file + # errors: + # unawaited_futures: ignore \ No newline at end of file diff --git a/lib/angel_client.dart b/lib/angel_client.dart index f681786b..72b2c223 100644 --- a/lib/angel_client.dart +++ b/lib/angel_client.dart @@ -342,6 +342,6 @@ class ServiceList extends DelegatingList { Stream> get onChange => _onChange.stream; Future close() async { - _onChange.close(); + await _onChange.close(); } } diff --git a/lib/base_angel_client.dart b/lib/base_angel_client.dart index 87fd305e..f11eb3aa 100644 --- a/lib/base_angel_client.dart +++ b/lib/base_angel_client.dart @@ -106,8 +106,8 @@ abstract class BaseAngelClient extends Angel { Future close() async { client.close(); - _onAuthenticated.close(); - Future.wait(_services.map((s) => s.close())).then((_) { + await _onAuthenticated.close(); + await Future.wait(_services.map((s) => s.close())).then((_) { _services.clear(); }); } @@ -162,7 +162,7 @@ abstract class BaseAngelClient extends Angel { Uri _join(url) { var u = url is Uri ? url : Uri.parse(url.toString()); if (u.hasScheme || u.hasAuthority) return u; - return baseUrl.replace(path: p.join(baseUrl.path, u.path)); + return u.replace(path: p.join(baseUrl.path, u.path)); } @override @@ -233,12 +233,12 @@ class BaseAngelService extends Service { @override Future close() async { - _onIndexed.close(); - _onRead.close(); - _onCreated.close(); - _onModified.close(); - _onUpdated.close(); - _onRemoved.close(); + await _onIndexed.close(); + await _onRead.close(); + await _onCreated.close(); + await _onModified.close(); + await _onUpdated.close(); + await _onRemoved.close(); } BaseAngelService(this.client, this.app, baseUrl, {this.deserializer}) diff --git a/lib/io.dart b/lib/io.dart index 85ad0822..c94a4ee2 100644 --- a/lib/io.dart +++ b/lib/io.dart @@ -32,8 +32,8 @@ class Rest extends BaseAngelClient { } Future close() async { - super.close(); - Future.wait(_services.map((s) => s.close())).then((_) { + await super.close(); + await Future.wait(_services.map((s) => s.close())).then((_) { _services.clear(); }); } diff --git a/pubspec.yaml b/pubspec.yaml index 2577954c..6888dffb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_client -version: 2.0.1 +version: 2.0.2 description: Support for querying Angel servers in the browser, Flutter, and command-line. author: Tobe O homepage: https://github.com/angel-dart/angel_client diff --git a/test/list_test.dart b/test/list_test.dart index 29beb3bf..50fd122d 100644 --- a/test/list_test.dart +++ b/test/list_test.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:angel_client/io.dart' as c; import 'package:angel_framework/angel_framework.dart' as s; import 'package:angel_framework/http.dart' as s; +import 'package:pedantic/pedantic.dart'; import 'package:test/test.dart'; main() { @@ -31,7 +32,7 @@ main() { }); test('listens on create', () async { - list.service.create({'foo': 'bar'}); + unawaited(list.service.create({'foo': 'bar'})); await list.onChange.first; expect(list, [ {'foo': 'bar'} @@ -39,7 +40,7 @@ main() { }); test('listens on modify', () async { - list.service.create({'id': 1, 'foo': 'bar'}); + unawaited(list.service.create({'id': 1, 'foo': 'bar'})); await queue.next; await list.service.update(1, {'id': 1, 'bar': 'baz'}); @@ -50,7 +51,7 @@ main() { }); test('listens on remove', () async { - list.service.create({'id': '1', 'foo': 'bar'}); + unawaited(list.service.create({'id': '1', 'foo': 'bar'})); await queue.next; await list.service.remove('1');