From ace278eded6e4f030c3c5993b5aac93db49a67cd Mon Sep 17 00:00:00 2001 From: Tyler-Larkin Date: Fri, 18 Oct 2024 10:45:35 -0700 Subject: [PATCH 1/4] chore(common,notifications): update os_detect to 2.0.2 (#5569) * chore(common,notifications): update os_detect to version 2.0.2 --- .../packages/aws_common/pubspec.yaml | 2 +- .../amplify_push_notifications/pubspec.yaml | 2 +- packages/aws_common/pubspec.yaml | 2 +- .../test/config/file_location_test.dart | 18 +++++++++--------- packages/aws_common/tool/generate_tests.dart | 2 +- .../amplify_push_notifications/pubspec.yaml | 2 +- .../amplify_push_notifications_impl_test.dart | 14 +++++++------- .../push_notification_flutter_api_test.dart | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml index 084e039b30..55ac36694f 100644 --- a/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: logging: ^1.0.0 meta: ^1.7.0 mime: ^1.0.0 - os_detect: ^2.0.0 + os_detect: ^2.0.2 path: ">=1.8.0 <2.0.0" stream_transform: ^2.0.0 uuid: ">=3.0.6 <5.0.0" diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/pubspec.yaml index d56c2fd498..0cbed520b8 100644 --- a/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/pubspec.yaml +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/notifications/push/amplify_push_notifications/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: flutter: sdk: flutter flutter_plugin_android_lifecycle: ^2.0.9 - os_detect: ^2.0.0 + os_detect: ^2.0.2 shared_preferences: ^2.0.15 dev_dependencies: diff --git a/packages/aws_common/pubspec.yaml b/packages/aws_common/pubspec.yaml index e855e0ce77..00ff68a7e3 100644 --- a/packages/aws_common/pubspec.yaml +++ b/packages/aws_common/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: logging: ^1.0.0 meta: ^1.7.0 mime: ^1.0.0 - os_detect: ^2.0.0 + os_detect: ^2.0.2 path: ">=1.8.0 <2.0.0" stream_transform: ^2.0.0 uuid: ">=3.0.6 <5.0.0" diff --git a/packages/aws_common/test/config/file_location_test.dart b/packages/aws_common/test/config/file_location_test.dart index fca22046e2..1ad94173ae 100644 --- a/packages/aws_common/test/config/file_location_test.dart +++ b/packages/aws_common/test/config/file_location_test.dart @@ -14,7 +14,7 @@ void main() { r'User home is loaded from $HOME with highest priority on non-windows platforms.', () { overrideOperatingSystem( - const OperatingSystem('linux', ''), + OperatingSystem('linux', ''), () { overrideEnvironment( { @@ -42,7 +42,7 @@ void main() { r'User home is loaded from $HOME with highest priority on windows platforms.', () { overrideOperatingSystem( - const OperatingSystem('windows', ''), + OperatingSystem('windows', ''), () { overrideEnvironment( { @@ -70,7 +70,7 @@ void main() { r'User home is loaded from $USERPROFILE on windows platforms when $HOME is not set.', () { overrideOperatingSystem( - const OperatingSystem('windows', ''), + OperatingSystem('windows', ''), () { overrideEnvironment( { @@ -97,7 +97,7 @@ void main() { r'User home is loaded from $HOMEDRIVE$HOMEPATH on windows platforms when $HOME and $USERPROFILE are not set.', () { overrideOperatingSystem( - const OperatingSystem('windows', ''), + OperatingSystem('windows', ''), () { overrideEnvironment( { @@ -123,7 +123,7 @@ void main() { r'The default config location can be overridden by the user on non-windows platforms.', () { overrideOperatingSystem( - const OperatingSystem('linux', ''), + OperatingSystem('linux', ''), () { overrideEnvironment( { @@ -149,7 +149,7 @@ void main() { r'The default credentials location can be overridden by the user on non-windows platforms.', () { overrideOperatingSystem( - const OperatingSystem('linux', ''), + OperatingSystem('linux', ''), () { overrideEnvironment( { @@ -175,7 +175,7 @@ void main() { r'The default credentials location can be overridden by the user on windows platforms.', () { overrideOperatingSystem( - const OperatingSystem('windows', ''), + OperatingSystem('windows', ''), () { overrideEnvironment( { @@ -201,7 +201,7 @@ void main() { r'The default credentials location can be overridden by the user on windows platforms.', () { overrideOperatingSystem( - const OperatingSystem('windows', ''), + OperatingSystem('windows', ''), () { overrideEnvironment( { @@ -226,7 +226,7 @@ void main() { test(r'The default profile can be overridden via environment variable.', () { overrideOperatingSystem( - const OperatingSystem('linux', ''), + OperatingSystem('linux', ''), () { overrideEnvironment( { diff --git a/packages/aws_common/tool/generate_tests.dart b/packages/aws_common/tool/generate_tests.dart index 6d18079bcd..57a7b15413 100644 --- a/packages/aws_common/tool/generate_tests.dart +++ b/packages/aws_common/tool/generate_tests.dart @@ -163,7 +163,7 @@ void main() { output.writeln( ''' test(r'${test.name}', () { - overrideOperatingSystem(const OperatingSystem('${test.platform.name}', ''), () { + overrideOperatingSystem(OperatingSystem('${test.platform.name}', ''), () { overrideEnvironment({ ${test.environment.entries.map((entry) => "'${entry.key}': r'${entry.value}',").join('\n')} }, () { diff --git a/packages/notifications/push/amplify_push_notifications/pubspec.yaml b/packages/notifications/push/amplify_push_notifications/pubspec.yaml index ef540fa1c2..d207d517f6 100644 --- a/packages/notifications/push/amplify_push_notifications/pubspec.yaml +++ b/packages/notifications/push/amplify_push_notifications/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: flutter: sdk: flutter flutter_plugin_android_lifecycle: ^2.0.9 - os_detect: ^2.0.0 + os_detect: ^2.0.2 shared_preferences: ^2.0.15 dev_dependencies: diff --git a/packages/notifications/push/amplify_push_notifications/test/amplify_push_notifications_impl_test.dart b/packages/notifications/push/amplify_push_notifications/test/amplify_push_notifications_impl_test.dart index 327911ee43..3f5bde26f7 100644 --- a/packages/notifications/push/amplify_push_notifications/test/amplify_push_notifications_impl_test.dart +++ b/packages/notifications/push/amplify_push_notifications/test/amplify_push_notifications_impl_test.dart @@ -132,7 +132,7 @@ void main() { test('should register background processor on Android', () async { await overrideOperatingSystem( - const OperatingSystem('android', ''), + OperatingSystem('android', ''), () async { when(mockPushNotificationsHostApi.getLaunchNotification()).thenAnswer( (_) async => standardAndroidPushMessage.cast(), @@ -254,7 +254,7 @@ void main() { ); overrideOperatingSystem( - const OperatingSystem('ios', ''), + OperatingSystem('ios', ''), () { expect( () async => plugin.setBadgeCount(42), @@ -388,7 +388,7 @@ void main() { }); test('getBadgeCount returns a badge count', () async { await overrideOperatingSystem( - const OperatingSystem('ios', ''), + OperatingSystem('ios', ''), () async { plugin = TestAmplifyPushNotifications( serviceProviderClient: mockServiceProviderClient, @@ -415,7 +415,7 @@ void main() { test('setBadgeCount calls the native layer to set', () async { await overrideOperatingSystem( - const OperatingSystem('ios', ''), + OperatingSystem('ios', ''), () async { plugin = TestAmplifyPushNotifications( serviceProviderClient: mockServiceProviderClient, @@ -487,7 +487,7 @@ void main() { 'onNotificationReceivedInBackground throws an Exception when the given callback function is not top-level or static', () async { overrideOperatingSystem( - const OperatingSystem('android', ''), + OperatingSystem('android', ''), () { plugin = TestAmplifyPushNotifications( serviceProviderClient: mockServiceProviderClient, @@ -514,7 +514,7 @@ void main() { 'onNotificationReceivedInBackground should register a top-level or static callback function', () async { await overrideOperatingSystem( - const OperatingSystem('android', ''), + OperatingSystem('android', ''), () async { SharedPreferences.setMockInitialValues({}); final pref = await SharedPreferences.getInstance(); @@ -534,7 +534,7 @@ void main() { test('onNotificationReceivedInBackground should accept the callback on iOS', () async { overrideOperatingSystem( - const OperatingSystem('ios', ''), + OperatingSystem('ios', ''), () { void localiOScallback(testGlobalCallbackFunction) {} plugin = TestAmplifyPushNotifications( diff --git a/packages/notifications/push/amplify_push_notifications/test/push_notification_flutter_api_test.dart b/packages/notifications/push/amplify_push_notifications/test/push_notification_flutter_api_test.dart index 75335c7a55..0035960d22 100644 --- a/packages/notifications/push/amplify_push_notifications/test/push_notification_flutter_api_test.dart +++ b/packages/notifications/push/amplify_push_notifications/test/push_notification_flutter_api_test.dart @@ -80,7 +80,7 @@ void main() { 'should invoke the top-level or static external callback function on Android', () async { await overrideOperatingSystem( - const OperatingSystem('android', ''), + OperatingSystem('android', ''), () async { final pref = await SharedPreferences.getInstance(); TestAmplifyPushNotifications( From 6e6edabfb08b4f57ad1f67c77f7e117e57c849e5 Mon Sep 17 00:00:00 2001 From: NikaHsn Date: Fri, 18 Oct 2024 13:51:57 -0700 Subject: [PATCH 2/4] chore(dep): update mime version to ^2.0.0 (#5568) --- .../repo_snapshot/packages/aws_common/pubspec.yaml | 2 +- .../version_bump/data/repo_snapshot/pubspec.yaml | 2 +- .../amplify_auth_cognito_dart/example/pubspec.yaml | 2 +- packages/aws_common/pubspec.yaml | 2 +- packages/test/pub_server/lib/src/server.dart | 13 ++++++++++--- packages/test/pub_server/pubspec.yaml | 2 +- pubspec.yaml | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml index 55ac36694f..f4218dcd9f 100644 --- a/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml +++ b/packages/aft/test/version_bump/data/repo_snapshot/packages/aws_common/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: json_annotation: ">=4.9.0 <4.10.0" logging: ^1.0.0 meta: ^1.7.0 - mime: ^1.0.0 + mime: ">=1.0.0 <3.0.0" os_detect: ^2.0.2 path: ">=1.8.0 <2.0.0" stream_transform: ^2.0.0 diff --git a/packages/aft/test/version_bump/data/repo_snapshot/pubspec.yaml b/packages/aft/test/version_bump/data/repo_snapshot/pubspec.yaml index 7038fca683..392888e035 100644 --- a/packages/aft/test/version_bump/data/repo_snapshot/pubspec.yaml +++ b/packages/aft/test/version_bump/data/repo_snapshot/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: intl: ">=0.18.0 <1.0.0" json_annotation: ">=4.9.0 <4.10.0" json_serializable: 6.8.0 - mime: ^1.0.0 + mime: ">=1.0.0 <3.0.0" oauth2: ^2.0.2 package_info_plus: ^8.0.0 pigeon: ^11.0.0 diff --git a/packages/auth/amplify_auth_cognito_dart/example/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/example/pubspec.yaml index 7798bd608c..98b9611bce 100644 --- a/packages/auth/amplify_auth_cognito_dart/example/pubspec.yaml +++ b/packages/auth/amplify_auth_cognito_dart/example/pubspec.yaml @@ -28,7 +28,7 @@ dev_dependencies: checks: ^0.3.0 cli_script: ^0.3.0 io: ^1.0.0 - mime: ^1.0.0 + mime: ">=1.0.0 <3.0.0" path: ">=1.8.0 <2.0.0" shelf: ^1.4.0 test: ^1.22.1 diff --git a/packages/aws_common/pubspec.yaml b/packages/aws_common/pubspec.yaml index 00ff68a7e3..250913a29b 100644 --- a/packages/aws_common/pubspec.yaml +++ b/packages/aws_common/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: json_annotation: ">=4.9.0 <4.10.0" logging: ^1.0.0 meta: ^1.7.0 - mime: ^1.0.0 + mime: ">=1.0.0 <3.0.0" os_detect: ^2.0.2 path: ">=1.8.0 <2.0.0" stream_transform: ^2.0.0 diff --git a/packages/test/pub_server/lib/src/server.dart b/packages/test/pub_server/lib/src/server.dart index 0aa06950f6..5cad678038 100644 --- a/packages/test/pub_server/lib/src/server.dart +++ b/packages/test/pub_server/lib/src/server.dart @@ -16,7 +16,7 @@ import 'package:pub_server/src/database.dart'; import 'package:pub_server/src/models.dart'; import 'package:pubspec_parse/pubspec_parse.dart'; import 'package:shelf/shelf.dart'; -import 'package:shelf_multipart/form_data.dart'; +import 'package:shelf_multipart/shelf_multipart.dart'; import 'package:shelf_router/shelf_router.dart'; part 'server.g.dart'; @@ -146,15 +146,22 @@ class PubServer { /// https://github.com/dart-lang/pub/blob/master/doc/repository-spec-v2.md#publishing-packages @Route.post('/api/packages/versions/newUpload') Future upload(Request request) async { - if (!request.isMultipartForm) { + if (request.multipart() == null) { return Response.badRequest( body: 'Expected multipart request', ); } + final formDataRequest = request.formData(); + if (formDataRequest == null) { + return Response.badRequest( + body: 'Expected multipart request to contain form data', + ); + } + final FormData packageTar; try { - packageTar = await request.multipartFormData.singleWhere( + packageTar = await formDataRequest.formData.singleWhere( (part) => part.filename == 'package.tar.gz', ); } on StateError { diff --git a/packages/test/pub_server/pubspec.yaml b/packages/test/pub_server/pubspec.yaml index 613e271ba2..b29627fbb2 100644 --- a/packages/test/pub_server/pubspec.yaml +++ b/packages/test/pub_server/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: pub_semver: ^2.1.3 pubspec_parse: ^1.2.2 shelf: ^1.4.0 - shelf_multipart: ^1.0.0 + shelf_multipart: ^2.0.0 shelf_router: ^1.1.3 yaml: ^3.1.1 diff --git a/pubspec.yaml b/pubspec.yaml index 7038fca683..392888e035 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: intl: ">=0.18.0 <1.0.0" json_annotation: ">=4.9.0 <4.10.0" json_serializable: 6.8.0 - mime: ^1.0.0 + mime: ">=1.0.0 <3.0.0" oauth2: ^2.0.2 package_info_plus: ^8.0.0 pigeon: ^11.0.0 From 8222a03d5f04f94be0a8e64aee749c69deaa4d06 Mon Sep 17 00:00:00 2001 From: Tyler-Larkin Date: Fri, 18 Oct 2024 15:49:49 -0700 Subject: [PATCH 3/4] fix(api): Reconnect WebSocket when resuming app from a paused state (#5567) * fix(api): Reconnect WebSocket when resuming app from a paused state --- packages/api/amplify_api/lib/amplify_api.dart | 6 +- .../amplify_api/lib/src/api_plugin_impl.dart | 2 + .../lib/src/flutter_life_cycle.dart | 42 ++++ .../lib/amplify_api_dart.dart | 1 + .../lib/src/api_plugin_impl.dart | 9 +- .../web_socket/blocs/web_socket_bloc.dart | 56 ++++++ .../web_socket/types/process_life_cycle.dart | 33 +++ .../web_socket/types/web_socket_event.dart | 13 ++ .../amplify_api_dart/test/graphql_test.dart | 4 + packages/api/amplify_api_dart/test/util.dart | 11 + .../test/web_socket/web_socket_bloc_test.dart | 190 ++++++++++++++++++ 11 files changed, 365 insertions(+), 2 deletions(-) create mode 100644 packages/api/amplify_api/lib/src/flutter_life_cycle.dart create mode 100644 packages/api/amplify_api_dart/lib/src/graphql/web_socket/types/process_life_cycle.dart diff --git a/packages/api/amplify_api/lib/amplify_api.dart b/packages/api/amplify_api/lib/amplify_api.dart index d27a2141f7..c7dbfa3f0a 100644 --- a/packages/api/amplify_api/lib/amplify_api.dart +++ b/packages/api/amplify_api/lib/amplify_api.dart @@ -5,4 +5,8 @@ library amplify_api; export 'package:amplify_api/src/api_plugin_impl.dart'; export 'package:amplify_api_dart/amplify_api_dart.dart' - hide AmplifyAPIDart, ConnectivityPlatform, ConnectivityStatus; + hide + AmplifyAPIDart, + ConnectivityPlatform, + ProcessLifeCycle, + ConnectivityStatus; diff --git a/packages/api/amplify_api/lib/src/api_plugin_impl.dart b/packages/api/amplify_api/lib/src/api_plugin_impl.dart index abd05fe314..dd23b97739 100644 --- a/packages/api/amplify_api/lib/src/api_plugin_impl.dart +++ b/packages/api/amplify_api/lib/src/api_plugin_impl.dart @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import 'package:amplify_api/src/connectivity_plus_platform.dart'; +import 'package:amplify_api/src/flutter_life_cycle.dart'; import 'package:amplify_api_dart/amplify_api_dart.dart'; import 'package:amplify_core/amplify_core.dart'; @@ -14,6 +15,7 @@ class AmplifyAPI extends AmplifyAPIDart with AWSDebuggable { super.options, }) : super( connectivity: const ConnectivityPlusPlatform(), + processLifeCycle: FlutterLifeCycle(), ); @override diff --git a/packages/api/amplify_api/lib/src/flutter_life_cycle.dart b/packages/api/amplify_api/lib/src/flutter_life_cycle.dart new file mode 100644 index 0000000000..92405745eb --- /dev/null +++ b/packages/api/amplify_api/lib/src/flutter_life_cycle.dart @@ -0,0 +1,42 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import 'dart:async'; + +import 'package:amplify_api_dart/amplify_api_dart.dart'; +import 'package:flutter/widgets.dart'; +import 'package:meta/meta.dart'; + +/// {@template amplify_api.flutter_life_cycle} +/// Creates a stream of [ProcessStatus] mapped from [AppLifecycleListener](https://api.flutter.dev/flutter/widgets/AppLifecycleListener-class.html). +/// {@endtemplate} +@internal +class FlutterLifeCycle extends ProcessLifeCycle { + /// {@macro amplify_api.flutter_life_cycle} + FlutterLifeCycle() { + AppLifecycleListener( + onStateChange: _onStateChange, + ); + } + + final _stateController = + StreamController.broadcast(sync: true); + + @override + Stream get onStateChanged => _stateController.stream; + + void _onStateChange(AppLifecycleState state) { + switch (state) { + case AppLifecycleState.detached: + _stateController.add(ProcessStatus.detached); + case AppLifecycleState.paused: + _stateController.add(ProcessStatus.paused); + case AppLifecycleState.hidden: + _stateController.add(ProcessStatus.hidden); + case AppLifecycleState.inactive: + _stateController.add(ProcessStatus.inactive); + case AppLifecycleState.resumed: + _stateController.add(ProcessStatus.resumed); + } + } +} diff --git a/packages/api/amplify_api_dart/lib/amplify_api_dart.dart b/packages/api/amplify_api_dart/lib/amplify_api_dart.dart index e25c15fb25..d689d1ccde 100644 --- a/packages/api/amplify_api_dart/lib/amplify_api_dart.dart +++ b/packages/api/amplify_api_dart/lib/amplify_api_dart.dart @@ -19,3 +19,4 @@ export 'src/graphql/model_helpers/model_subscriptions.dart'; /// Network connectivity util not needed by consumers of Flutter package amplify_api. export 'src/graphql/web_socket/types/connectivity_platform.dart'; +export 'src/graphql/web_socket/types/process_life_cycle.dart'; diff --git a/packages/api/amplify_api_dart/lib/src/api_plugin_impl.dart b/packages/api/amplify_api_dart/lib/src/api_plugin_impl.dart index 1cda540419..c4248bbc45 100644 --- a/packages/api/amplify_api_dart/lib/src/api_plugin_impl.dart +++ b/packages/api/amplify_api_dart/lib/src/api_plugin_impl.dart @@ -11,6 +11,7 @@ import 'package:amplify_api_dart/src/graphql/web_socket/blocs/web_socket_bloc.da import 'package:amplify_api_dart/src/graphql/web_socket/services/web_socket_service.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/state/web_socket_state.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/types/connectivity_platform.dart'; +import 'package:amplify_api_dart/src/graphql/web_socket/types/process_life_cycle.dart'; import 'package:amplify_api_dart/src/util/amplify_api_config.dart'; import 'package:amplify_api_dart/src/util/amplify_authorization_rest_client.dart'; import 'package:amplify_core/amplify_core.dart'; @@ -30,8 +31,10 @@ class AmplifyAPIDart extends APIPluginInterface with AWSDebuggable { AmplifyAPIDart({ APIPluginOptions options = const APIPluginOptions(), ConnectivityPlatform connectivity = const ConnectivityPlatform(), + ProcessLifeCycle processLifeCycle = const ProcessLifeCycle(), }) : _options = options, - _connectivity = connectivity { + _connectivity = connectivity, + _processLifeCycle = processLifeCycle { _options.authProviders.forEach(registerAuthProvider); } @@ -43,6 +46,9 @@ class AmplifyAPIDart extends APIPluginInterface with AWSDebuggable { /// Creates a stream representing network connectivity at the hardware level. final ConnectivityPlatform _connectivity; + /// Creates a stream representing the process life cycle state. + final ProcessLifeCycle _processLifeCycle; + /// A map of the keys from the Amplify API config with auth modes to HTTP clients /// to use for requests to that endpoint/auth mode. e.g. { "myEndpoint.AWS_IAM": AWSHttpClient} final Map _clientPool = {}; @@ -277,6 +283,7 @@ class AmplifyAPIDart extends APIPluginInterface with AWSDebuggable { wsService: AmplifyWebSocketService(), subscriptionOptions: _options.subscriptionOptions, connectivity: _connectivity, + processLifeCycle: _processLifeCycle, ); } diff --git a/packages/api/amplify_api_dart/lib/src/graphql/web_socket/blocs/web_socket_bloc.dart b/packages/api/amplify_api_dart/lib/src/graphql/web_socket/blocs/web_socket_bloc.dart index 0903db904b..b3a3d90089 100644 --- a/packages/api/amplify_api_dart/lib/src/graphql/web_socket/blocs/web_socket_bloc.dart +++ b/packages/api/amplify_api_dart/lib/src/graphql/web_socket/blocs/web_socket_bloc.dart @@ -9,6 +9,7 @@ import 'package:amplify_api_dart/src/graphql/web_socket/services/web_socket_serv import 'package:amplify_api_dart/src/graphql/web_socket/state/web_socket_state.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/state/ws_subscriptions_state.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/types/connectivity_platform.dart'; +import 'package:amplify_api_dart/src/graphql/web_socket/types/process_life_cycle.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/types/subscriptions_event.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/types/web_socket_types.dart'; import 'package:amplify_core/amplify_core.dart' hide SubscriptionEvent; @@ -33,8 +34,10 @@ class WebSocketBloc with AWSDebuggable, AmplifyLoggerMixin { required WebSocketService wsService, required GraphQLSubscriptionOptions subscriptionOptions, required ConnectivityPlatform connectivity, + required ProcessLifeCycle processLifeCycle, AWSHttpClient? pollClientOverride, }) : _connectivity = connectivity, + _processLifeCycle = processLifeCycle, _pollClient = pollClientOverride ?? AWSHttpClient() { final subBlocs = >{}; @@ -49,6 +52,7 @@ class WebSocketBloc with AWSDebuggable, AmplifyLoggerMixin { ); final blocStream = _wsEventStream.asyncExpand(_eventTransformer); _networkSubscription = _getConnectivityStream(); + _processLifeCycleSubscription = _getProcessLifecycleStream(); _stateSubscription = blocStream.listen(_emit); add(const InitEvent()); } @@ -81,10 +85,14 @@ class WebSocketBloc with AWSDebuggable, AmplifyLoggerMixin { late final Stream _wsEventStream = _wsEventController.stream; late final StreamSubscription _stateSubscription; late final StreamSubscription _networkSubscription; + late final StreamSubscription _processLifeCycleSubscription; /// Creates a stream representing network connectivity at the hardware level. final ConnectivityPlatform _connectivity; + /// Creates a stream representing the process life cycle state. + final ProcessLifeCycle _processLifeCycle; + /// The underlying event stream, used only in testing. @visibleForTesting Stream get wsEventStream => _wsEventStream; @@ -164,6 +172,8 @@ class WebSocketBloc with AWSDebuggable, AmplifyLoggerMixin { yield* _networkLoss(); } else if (event is NetworkFoundEvent) { yield* _networkFound(); + } else if (event is ProcessResumeEvent) { + yield* _processResumed(); } else if (event is PollSuccessEvent) { yield* _pollSuccess(); } else if (event is PollFailedEvent) { @@ -328,6 +338,16 @@ class WebSocketBloc with AWSDebuggable, AmplifyLoggerMixin { yield* const Stream.empty(); } + Stream _processResumed() async* { + final state = _currentState; + if (state is ConnectedState) { + yield state.reconnecting(networkState: NetworkState.disconnected); + add(const ReconnectEvent()); + } + // TODO(dnys1): Yield broken on web debug build. + yield* const Stream.empty(); + } + /// Handle successful polls Stream _pollSuccess() async* { // TODO(dnys1): Yield broken on web debug build. @@ -467,6 +487,7 @@ class WebSocketBloc with AWSDebuggable, AmplifyLoggerMixin { await Future.wait([ // TODO(equartey): https://github.com/fluttercommunity/plus_plugins/issues/1382 if (!isWindows()) _networkSubscription.cancel(), + _processLifeCycleSubscription.cancel(), Future.value(_pollClient.close()), _stateSubscription.cancel(), _wsEventController.close(), @@ -507,6 +528,41 @@ class WebSocketBloc with AWSDebuggable, AmplifyLoggerMixin { ); } + /// Process life cycle stream monitors when the process resumes from a paused state. + StreamSubscription _getProcessLifecycleStream() { + var prev = ProcessStatus.detached; + return _processLifeCycle.onStateChanged.listen( + (state) { + if (_isResuming(state, prev)) { + // ignore: invalid_use_of_internal_member + if (!WebSocketOptions.autoReconnect) { + _shutdownWithException( + const NetworkException( + 'Unable to recover network connection, web socket will close.', + recoverySuggestion: 'Avoid pausing the process.', + ), + StackTrace.current, + ); + } else { + add(const ProcessResumeEvent()); + } + } + + prev = state; + }, + onError: (Object e, StackTrace st) => + logger.error('Error in process life cycle stream $e, $st'), + ); + } + + bool _isResuming(ProcessStatus current, ProcessStatus previous) { + if (previous != ProcessStatus.paused) return false; + + return current == ProcessStatus.hidden || + current == ProcessStatus.inactive || + current == ProcessStatus.resumed; + } + Future _poll() async { try { final res = await _sendPollRequest(); diff --git a/packages/api/amplify_api_dart/lib/src/graphql/web_socket/types/process_life_cycle.dart b/packages/api/amplify_api_dart/lib/src/graphql/web_socket/types/process_life_cycle.dart new file mode 100644 index 0000000000..ca9ed6e085 --- /dev/null +++ b/packages/api/amplify_api_dart/lib/src/graphql/web_socket/types/process_life_cycle.dart @@ -0,0 +1,33 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +/// Possible process life cycle states +enum ProcessStatus { + /// Engine is running without a view. + detached, + + /// Application is not visible to the user or responding to user input. + paused, + + /// All views of an application are hidden. + hidden, + + /// A view of the application is visible, but none have input. + inactive, + + /// Default running mode. + resumed, +} + +/// {@template amplify_api_dart.process_life_cycle} +/// Used to create a stream representing the process life cycle state. +/// +/// The generated stream is empty. +/// {@endtemplate} +class ProcessLifeCycle { + /// {@macro amplify_api_dart.process_life_cycle} + const ProcessLifeCycle(); + + /// Generates a new stream of [ProcessStatus]. + Stream get onStateChanged => const Stream.empty(); +} diff --git a/packages/api/amplify_api_dart/lib/src/graphql/web_socket/types/web_socket_event.dart b/packages/api/amplify_api_dart/lib/src/graphql/web_socket/types/web_socket_event.dart index 907cd6f28d..a4f5d31b36 100644 --- a/packages/api/amplify_api_dart/lib/src/graphql/web_socket/types/web_socket_event.dart +++ b/packages/api/amplify_api_dart/lib/src/graphql/web_socket/types/web_socket_event.dart @@ -88,6 +88,19 @@ class NetworkLossEvent extends NetworkEvent { String get runtimeTypeName => 'NetworkLossEvent'; } +/// Discrete class for when the process is resumed +/// Triggers when AppLifecycleListener detects the process has been resumed. +class ProcessResumeEvent extends WebSocketEvent { + /// Create a process resumed event + const ProcessResumeEvent(); + + @override + String get runtimeTypeName => 'ProcessResumeEvent'; + + @override + Map toJson() => const {}; +} + /// Triggers when a successful ping to AppSync is made class PollSuccessEvent extends WebSocketEvent { /// Create a successful Poll event diff --git a/packages/api/amplify_api_dart/test/graphql_test.dart b/packages/api/amplify_api_dart/test/graphql_test.dart index c1399a0025..c2dd679594 100644 --- a/packages/api/amplify_api_dart/test/graphql_test.dart +++ b/packages/api/amplify_api_dart/test/graphql_test.dart @@ -280,6 +280,7 @@ void main() { 'payload': {'data': mockSubscriptionData}, }; + mockProcessLifeCycleController = StreamController(); mockWebSocketService = MockWebSocketService(); const subscriptionOptions = GraphQLSubscriptionOptions( pollInterval: Duration(seconds: 1), @@ -292,6 +293,7 @@ void main() { subscriptionOptions: subscriptionOptions, pollClientOverride: mockClient.client, connectivity: const ConnectivityPlatform(), + processLifeCycle: const MockProcessLifeCycle(), ); sendMockConnectionAck(mockWebSocketBloc!, mockWebSocketService!); @@ -599,6 +601,7 @@ void main() { }); test('should have correct state flow during a failure', () async { + mockProcessLifeCycleController = StreamController(); mockWebSocketService = MockWebSocketService(); const subscriptionOptions = GraphQLSubscriptionOptions( pollInterval: Duration(seconds: 1), @@ -613,6 +616,7 @@ void main() { subscriptionOptions: subscriptionOptions, pollClientOverride: mockClient.client, connectivity: const ConnectivityPlatform(), + processLifeCycle: const MockProcessLifeCycle(), ); final blocReady = Completer(); diff --git a/packages/api/amplify_api_dart/test/util.dart b/packages/api/amplify_api_dart/test/util.dart index f4d7e9e390..0d65f7ee93 100644 --- a/packages/api/amplify_api_dart/test/util.dart +++ b/packages/api/amplify_api_dart/test/util.dart @@ -10,6 +10,7 @@ import 'package:amplify_api_dart/src/graphql/web_socket/blocs/web_socket_bloc.da import 'package:amplify_api_dart/src/graphql/web_socket/services/web_socket_service.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/state/web_socket_state.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/types/connectivity_platform.dart'; +import 'package:amplify_api_dart/src/graphql/web_socket/types/process_life_cycle.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/types/web_socket_types.dart'; import 'package:amplify_core/amplify_core.dart'; import 'package:amplify_core/src/config/amplify_outputs/data/data_outputs.dart'; @@ -329,6 +330,16 @@ class MockConnectivity extends ConnectivityPlatform { mockNetworkStreamController.stream; } +late StreamController mockProcessLifeCycleController; + +class MockProcessLifeCycle extends ProcessLifeCycle { + const MockProcessLifeCycle(); + + @override + Stream get onStateChanged => + mockProcessLifeCycleController.stream; +} + /// Ensures a query predicate converts to JSON correctly. void testQueryPredicateTranslation( QueryPredicate? queryPredicate, diff --git a/packages/api/amplify_api_dart/test/web_socket/web_socket_bloc_test.dart b/packages/api/amplify_api_dart/test/web_socket/web_socket_bloc_test.dart index cf4ca8f769..297970268f 100644 --- a/packages/api/amplify_api_dart/test/web_socket/web_socket_bloc_test.dart +++ b/packages/api/amplify_api_dart/test/web_socket/web_socket_bloc_test.dart @@ -7,6 +7,7 @@ import 'dart:convert'; import 'package:amplify_api_dart/src/graphql/web_socket/blocs/web_socket_bloc.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/state/web_socket_state.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/types/connectivity_platform.dart'; +import 'package:amplify_api_dart/src/graphql/web_socket/types/process_life_cycle.dart'; import 'package:amplify_api_dart/src/graphql/web_socket/types/web_socket_types.dart'; import 'package:amplify_core/amplify_core.dart'; import 'package:test/test.dart'; @@ -54,6 +55,7 @@ void main() { if (!noConnectivity) { mockNetworkStreamController = StreamController(); } + mockProcessLifeCycleController = StreamController(); mockPollClient = MockPollClient(); service = MockWebSocketService(); @@ -66,6 +68,7 @@ void main() { connectivity: noConnectivity ? const ConnectivityPlatform() : const MockConnectivity(), + processLifeCycle: const MockProcessLifeCycle(), ); sendMockConnectionAck(bloc!, service!); @@ -307,6 +310,149 @@ void main() { mockPollClient.induceTimeout = false; }); + test('should reconnect when process resumes', () async { + var dataCompleter = Completer(); + final subscribeEvent = SubscribeEvent( + subscriptionRequest, + () { + service!.channel.sink.add(mockDataString); + }, + ); + + final bloc = getWebSocketBloc(); + + expect( + bloc.stream, + emitsInOrder( + [ + isA(), + isA(), + isA(), + isA(), + isA(), + isA(), + ], + ), + ); + + bloc.subscribe(subscribeEvent).listen( + expectAsync1( + (event) { + expect(event.data, json.encode(mockSubscriptionData)); + dataCompleter.complete(event.data); + }, + count: 2, + ), + ); + + await dataCompleter.future; + dataCompleter = Completer(); + + mockProcessLifeCycleController + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed); + + await expectLater(bloc.stream, emitsThrough(isA())); + + service!.channel.sink.add(mockDataString); + await dataCompleter.future; + }); + + test('should throttle reconnect after repeatedly resuming', () async { + final blocReady = Completer(); + final subscribeEvent = SubscribeEvent( + subscriptionRequest, + blocReady.complete, + ); + + final bloc = getWebSocketBloc(); + + expect( + bloc.stream, + emitsInOrder( + [ + isA(), + isA(), + isA(), + isA(), + isA(), + isA(), + ], + ), + reason: + 'Bloc should debounce multiple reconnection triggers while resuming.', + ); + + bloc.subscribe( + subscribeEvent, + ); + + await blocReady.future; + + mockProcessLifeCycleController + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed) + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed) + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed) + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed) + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed); + }); + + test('should reconnect multiple times after resuming', () async { + final blocReady = Completer(); + final subscribeEvent = SubscribeEvent( + subscriptionRequest, + blocReady.complete, + ); + + final bloc = getWebSocketBloc() + ..subscribe( + subscribeEvent, + ); + + await blocReady.future; + + mockProcessLifeCycleController + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed); + + await expectLater(bloc.stream, emitsThrough(isA())); + + mockProcessLifeCycleController + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed); + + await expectLater(bloc.stream, emitsThrough(isA())); + + mockProcessLifeCycleController + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed); + + await expectLater(bloc.stream, emitsThrough(isA())); + + mockProcessLifeCycleController + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed); + + await expectLater(bloc.stream, emitsThrough(isA())); + + mockProcessLifeCycleController + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed); + + await expectLater(bloc.stream, emitsThrough(isA())); + + mockProcessLifeCycleController + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed); + + await expectLater(bloc.stream, emitsThrough(isA())); + }); + test( 'subscribe() ignores a WebSocket message that comes while the bloc is disconnected', () async { @@ -348,6 +494,7 @@ void main() { final badService = MockWebSocketService(badInit: true); mockNetworkStreamController = StreamController(); + mockProcessLifeCycleController = StreamController(); final bloc = WebSocketBloc( config: testApiKeyConfig, authProviderRepo: getTestAuthProviderRepo(), @@ -355,6 +502,7 @@ void main() { subscriptionOptions: subscriptionOptions, pollClientOverride: mockPollClient.client, connectivity: const MockConnectivity(), + processLifeCycle: const MockProcessLifeCycle(), ); expect( @@ -491,6 +639,48 @@ void main() { await bloc.done.future; }); + + test('a process resumes with autoReconnect disabled', () async { + final blocReady = Completer(); + final subscribeEvent = SubscribeEvent( + subscriptionRequest, + blocReady.complete, + ); + final bloc = getWebSocketBloc(); + + expect( + bloc.stream, + emitsInOrder( + [ + isA(), + isA(), + isA(), + isA(), + isA(), + isA(), + ], + ), + ); + + // ignore: invalid_use_of_internal_member + WebSocketOptions.autoReconnect = false; + + bloc.subscribe(subscribeEvent).listen( + null, + onError: expectAsync1((event) { + expect( + event, + isA(), + ); + }), + ); + + await blocReady.future; + + mockProcessLifeCycleController + ..add(ProcessStatus.paused) + ..add(ProcessStatus.resumed); + }); }); }); } From 25fe3f08c281f6b6cb77ebe76a8114b363596635 Mon Sep 17 00:00:00 2001 From: Elijah Quartey Date: Wed, 23 Oct 2024 09:44:27 -0500 Subject: [PATCH 4/4] chore: Cherry Pick Bump version (#5593) chore(version): Bump version ### Features - feat(api): move App Sync subscription headers to protocol ([#5301](https://github.com/aws-amplify/amplify-flutter/pull/5301)) - feat(authenticator): export unmet password requirements ([#5437](https://github.com/aws-amplify/amplify-flutter/pull/5437)) ### Fixes - fix(api): Reconnect WebSocket when resuming app from a paused state ([#5567](https://github.com/aws-amplify/amplify-flutter/pull/5567)) Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee --- packages/amplify_core/CHANGELOG.md | 8 ++++++++ packages/amplify_core/lib/src/version.dart | 2 +- packages/amplify_core/pubspec.yaml | 4 ++-- packages/amplify_datastore/CHANGELOG.md | 4 ++++ packages/amplify_datastore/pubspec.yaml | 4 ++-- packages/api/amplify_api/CHANGELOG.md | 5 +++++ packages/api/amplify_api/pubspec.yaml | 6 +++--- packages/api/amplify_api_dart/CHANGELOG.md | 8 ++++++++ packages/api/amplify_api_dart/pubspec.yaml | 6 +++--- packages/auth/amplify_auth_cognito/CHANGELOG.md | 4 ++++ packages/auth/amplify_auth_cognito/pubspec.yaml | 6 +++--- packages/auth/amplify_auth_cognito_dart/CHANGELOG.md | 4 ++++ packages/auth/amplify_auth_cognito_dart/pubspec.yaml | 6 +++--- packages/authenticator/amplify_authenticator/CHANGELOG.md | 5 +++++ .../amplify_authenticator/lib/src/version.dart | 2 +- packages/authenticator/amplify_authenticator/pubspec.yaml | 8 ++++---- packages/aws_common/CHANGELOG.md | 4 ++++ packages/aws_common/pubspec.yaml | 2 +- .../push/amplify_push_notifications/CHANGELOG.md | 4 ++++ .../push/amplify_push_notifications/pubspec.yaml | 4 ++-- 20 files changed, 71 insertions(+), 25 deletions(-) diff --git a/packages/amplify_core/CHANGELOG.md b/packages/amplify_core/CHANGELOG.md index 69bd5e98e2..57b663a848 100644 --- a/packages/amplify_core/CHANGELOG.md +++ b/packages/amplify_core/CHANGELOG.md @@ -1,3 +1,11 @@ +## 2.4.2 + +### Features +- feat(api): move App Sync subscription headers to protocol ([#5301](https://github.com/aws-amplify/amplify-flutter/pull/5301)) + +### Fixes +- fix(api): Reconnect WebSocket when resuming app from a paused state ([#5567](https://github.com/aws-amplify/amplify-flutter/pull/5567)) + ## 2.4.1 ### Fixes diff --git a/packages/amplify_core/lib/src/version.dart b/packages/amplify_core/lib/src/version.dart index 38a2ff8a2f..b4cefe9232 100644 --- a/packages/amplify_core/lib/src/version.dart +++ b/packages/amplify_core/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '2.4.1'; +const packageVersion = '2.4.2'; diff --git a/packages/amplify_core/pubspec.yaml b/packages/amplify_core/pubspec.yaml index 4ebcdaceed..7de06f6b02 100644 --- a/packages/amplify_core/pubspec.yaml +++ b/packages/amplify_core/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_core description: The base package containing common types and utilities that are shared across the Amplify Flutter packages. -version: 2.4.1 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_core issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -10,7 +10,7 @@ environment: dependencies: async: ^2.10.0 - aws_common: ">=0.7.3 <0.8.0" + aws_common: ">=0.7.4 <0.8.0" aws_signature_v4: ">=0.6.3 <0.7.0" collection: ^1.15.0 graphs: ^2.1.0 diff --git a/packages/amplify_datastore/CHANGELOG.md b/packages/amplify_datastore/CHANGELOG.md index f999eeb60e..4194b55191 100644 --- a/packages/amplify_datastore/CHANGELOG.md +++ b/packages/amplify_datastore/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.2 + +- Minor bug fixes and improvements + ## 2.4.1 ### Fixes diff --git a/packages/amplify_datastore/pubspec.yaml b/packages/amplify_datastore/pubspec.yaml index 07899e3863..39fdc3fabe 100644 --- a/packages/amplify_datastore/pubspec.yaml +++ b/packages/amplify_datastore/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_datastore description: The Amplify Flutter DataStore category plugin, providing a queryable, on-device data store. -version: 2.4.1 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_datastore issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -13,7 +13,7 @@ dependencies: flutter: sdk: flutter amplify_datastore_plugin_interface: ">=2.4.1 <2.5.0" - amplify_core: ">=2.4.1 <2.5.0" + amplify_core: ">=2.4.2 <2.5.0" plugin_platform_interface: ^2.0.0 meta: ^1.7.0 collection: ^1.14.13 diff --git a/packages/api/amplify_api/CHANGELOG.md b/packages/api/amplify_api/CHANGELOG.md index 2e7c3ff146..bec52dc75b 100644 --- a/packages/api/amplify_api/CHANGELOG.md +++ b/packages/api/amplify_api/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.4.2 + +### Fixes +- fix(api): Reconnect WebSocket when resuming app from a paused state ([#5567](https://github.com/aws-amplify/amplify-flutter/pull/5567)) + ## 2.4.1 - Minor bug fixes and improvements diff --git a/packages/api/amplify_api/pubspec.yaml b/packages/api/amplify_api/pubspec.yaml index 63ebd86fc9..d401c15680 100644 --- a/packages/api/amplify_api/pubspec.yaml +++ b/packages/api/amplify_api/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_api description: The Amplify Flutter API category plugin, supporting GraphQL and REST operations. -version: 2.4.1 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/api/amplify_api issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -19,8 +19,8 @@ platforms: web: dependencies: - amplify_api_dart: ">=0.5.5 <0.6.0" - amplify_core: ">=2.4.1 <2.5.0" + amplify_api_dart: ">=0.5.6 <0.6.0" + amplify_core: ">=2.4.2 <2.5.0" amplify_flutter: ">=2.4.1 <2.5.0" connectivity_plus: ^6.0.1 flutter: diff --git a/packages/api/amplify_api_dart/CHANGELOG.md b/packages/api/amplify_api_dart/CHANGELOG.md index a29df4e351..4d8fd7e87f 100644 --- a/packages/api/amplify_api_dart/CHANGELOG.md +++ b/packages/api/amplify_api_dart/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.5.6 + +### Features +- feat(api): move App Sync subscription headers to protocol ([#5301](https://github.com/aws-amplify/amplify-flutter/pull/5301)) + +### Fixes +- fix(api): Reconnect WebSocket when resuming app from a paused state ([#5567](https://github.com/aws-amplify/amplify-flutter/pull/5567)) + ## 0.5.5 ### Fixes diff --git a/packages/api/amplify_api_dart/pubspec.yaml b/packages/api/amplify_api_dart/pubspec.yaml index b8baaa6fb3..7d7b3110c9 100644 --- a/packages/api/amplify_api_dart/pubspec.yaml +++ b/packages/api/amplify_api_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_api_dart description: The Amplify API category plugin in Dart-only, supporting GraphQL and REST operations. -version: 0.5.5 +version: 0.5.6 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/api/amplify_api_dart issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -9,9 +9,9 @@ environment: sdk: ^3.3.0 dependencies: - amplify_core: ">=2.4.1 <2.5.0" + amplify_core: ">=2.4.2 <2.5.0" async: ^2.10.0 - aws_common: ">=0.7.3 <0.8.0" + aws_common: ">=0.7.4 <0.8.0" collection: ^1.15.0 json_annotation: ">=4.9.0 <4.10.0" meta: ^1.7.0 diff --git a/packages/auth/amplify_auth_cognito/CHANGELOG.md b/packages/auth/amplify_auth_cognito/CHANGELOG.md index 4a6f8dea81..c548a18633 100644 --- a/packages/auth/amplify_auth_cognito/CHANGELOG.md +++ b/packages/auth/amplify_auth_cognito/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.2 + +- Minor bug fixes and improvements + ## 2.4.1 - Minor bug fixes and improvements diff --git a/packages/auth/amplify_auth_cognito/pubspec.yaml b/packages/auth/amplify_auth_cognito/pubspec.yaml index f8e194b01b..e97fcf589a 100644 --- a/packages/auth/amplify_auth_cognito/pubspec.yaml +++ b/packages/auth/amplify_auth_cognito/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_auth_cognito description: The Amplify Flutter Auth category plugin using the AWS Cognito provider. -version: 2.4.1 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/auth/amplify_auth_cognito issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -21,8 +21,8 @@ platforms: dependencies: amplify_analytics_pinpoint: ">=2.4.1 <2.5.0" amplify_analytics_pinpoint_dart: ">=0.4.5 <0.5.0" - amplify_auth_cognito_dart: ">=0.11.5 <0.12.0" - amplify_core: ">=2.4.1 <2.5.0" + amplify_auth_cognito_dart: ">=0.11.6 <0.12.0" + amplify_core: ">=2.4.2 <2.5.0" amplify_flutter: ">=2.4.1 <2.5.0" amplify_secure_storage: ">=0.5.7 <0.6.0" async: ^2.10.0 diff --git a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md index 91e78afdd0..02f5560230 100644 --- a/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md +++ b/packages/auth/amplify_auth_cognito_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.11.6 + +- Minor bug fixes and improvements + ## 0.11.5 - Minor bug fixes and improvements diff --git a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml index 3c834f8dc1..c60f314f78 100644 --- a/packages/auth/amplify_auth_cognito_dart/pubspec.yaml +++ b/packages/auth/amplify_auth_cognito_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_auth_cognito_dart description: A Dart-only implementation of the Amplify Auth plugin for Cognito. -version: 0.11.5 +version: 0.11.6 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/next/packages/auth/amplify_auth_cognito_dart issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -10,10 +10,10 @@ environment: dependencies: amplify_analytics_pinpoint_dart: ">=0.4.5 <0.5.0" - amplify_core: ">=2.4.1 <2.5.0" + amplify_core: ">=2.4.2 <2.5.0" amplify_secure_storage_dart: ">=0.5.3 <0.6.0" async: ^2.10.0 - aws_common: ">=0.7.3 <0.8.0" + aws_common: ">=0.7.4 <0.8.0" aws_signature_v4: ">=0.6.3 <0.7.0" built_collection: ^5.0.0 built_value: ^8.6.0 diff --git a/packages/authenticator/amplify_authenticator/CHANGELOG.md b/packages/authenticator/amplify_authenticator/CHANGELOG.md index c8c0a9914f..65b285f298 100644 --- a/packages/authenticator/amplify_authenticator/CHANGELOG.md +++ b/packages/authenticator/amplify_authenticator/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.2.0 + +### Features +- feat(authenticator): export unmet password requirements ([#5437](https://github.com/aws-amplify/amplify-flutter/pull/5437)) + ## 2.1.3 - Minor bug fixes and improvements diff --git a/packages/authenticator/amplify_authenticator/lib/src/version.dart b/packages/authenticator/amplify_authenticator/lib/src/version.dart index d09e279270..3f25c8a68c 100644 --- a/packages/authenticator/amplify_authenticator/lib/src/version.dart +++ b/packages/authenticator/amplify_authenticator/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '2.1.3'; +const packageVersion = '2.2.0'; diff --git a/packages/authenticator/amplify_authenticator/pubspec.yaml b/packages/authenticator/amplify_authenticator/pubspec.yaml index 924d21c87e..8410a0b182 100644 --- a/packages/authenticator/amplify_authenticator/pubspec.yaml +++ b/packages/authenticator/amplify_authenticator/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_authenticator description: A prebuilt Sign In and Sign Up experience for the Amplify Auth category -version: 2.1.3 +version: 2.2.0 homepage: https://ui.docs.amplify.aws/flutter/connected-components/authenticator repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/authenticator/amplify_authenticator issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -10,11 +10,11 @@ environment: flutter: ">=3.19.0" dependencies: - amplify_auth_cognito: ">=2.4.1 <2.5.0" - amplify_core: ">=2.4.1 <2.5.0" + amplify_auth_cognito: ">=2.4.2 <2.5.0" + amplify_core: ">=2.4.2 <2.5.0" amplify_flutter: ">=2.4.1 <2.5.0" async: ^2.10.0 - aws_common: ">=0.7.3 <0.8.0" + aws_common: ">=0.7.4 <0.8.0" collection: ^1.15.0 flutter: sdk: flutter diff --git a/packages/aws_common/CHANGELOG.md b/packages/aws_common/CHANGELOG.md index fa9b3e93a9..49a0fe51e9 100644 --- a/packages/aws_common/CHANGELOG.md +++ b/packages/aws_common/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.7.4 + +- Minor bug fixes and improvements + ## 0.7.3 ### Features diff --git a/packages/aws_common/pubspec.yaml b/packages/aws_common/pubspec.yaml index 250913a29b..47ffbf3839 100644 --- a/packages/aws_common/pubspec.yaml +++ b/packages/aws_common/pubspec.yaml @@ -1,6 +1,6 @@ name: aws_common description: Common types and utilities used across AWS and Amplify packages. -version: 0.7.3 +version: 0.7.4 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/aws_common issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues diff --git a/packages/notifications/push/amplify_push_notifications/CHANGELOG.md b/packages/notifications/push/amplify_push_notifications/CHANGELOG.md index 402f0c7c8e..ecf9fa7938 100644 --- a/packages/notifications/push/amplify_push_notifications/CHANGELOG.md +++ b/packages/notifications/push/amplify_push_notifications/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.4.2 + +- Minor bug fixes and improvements + ## 2.4.1 - Minor bug fixes and improvements diff --git a/packages/notifications/push/amplify_push_notifications/pubspec.yaml b/packages/notifications/push/amplify_push_notifications/pubspec.yaml index d207d517f6..a3046d98bd 100644 --- a/packages/notifications/push/amplify_push_notifications/pubspec.yaml +++ b/packages/notifications/push/amplify_push_notifications/pubspec.yaml @@ -1,6 +1,6 @@ name: amplify_push_notifications description: The Amplify Flutter Push Notifications package implementing features agnostic of an AWS Service such as Pinpoint. -version: 2.4.1 +version: 2.4.2 homepage: https://docs.amplify.aws/lib/q/platform/flutter/ issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues @@ -9,7 +9,7 @@ environment: flutter: ">=3.19.0" dependencies: - amplify_core: ">=2.4.1 <2.5.0" + amplify_core: ">=2.4.2 <2.5.0" amplify_secure_storage: ">=0.5.5 <0.6.0" async: ^2.10.0 flutter: