Skip to content

Commit ea9a678

Browse files
authored
fix(aws_common): removed JS streamed requests (#5797)
Removed JS streamed requests and fixed linter warnings
1 parent 6e7a4f8 commit ea9a678

File tree

8 files changed

+2
-21
lines changed

8 files changed

+2
-21
lines changed

packages/amplify_core/lib/src/types/auth/attribute/auth_user_attribute_key.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:meta/meta.dart';
99
/// {@template amplify_core.auth_user_attribute_key}
1010
/// A user attribute identifier.
1111
/// {@endtemplate}
12-
/// {@hideConstantImplementations}
1312
@immutable
1413
abstract class AuthUserAttributeKey
1514
with

packages/amplify_core/lib/src/types/auth/attribute/cognito_user_attribute_key.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import 'package:amplify_core/amplify_core.dart';
1212
/// [here](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html).
1313
///
1414
/// Use [CognitoUserAttributeKey.custom] to create a custom Cognito attribute.
15-
/// {@hideConstantImplementations}
1615
class CognitoUserAttributeKey extends AuthUserAttributeKey {
1716
const CognitoUserAttributeKey._(this._key, {this.readOnly = false})
1817
: isCustom = false;

packages/amplify_datastore/lib/src/utils/native_api_helpers.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'dart:convert';
22

33
import 'package:amplify_core/amplify_core.dart';
44
import 'package:amplify_datastore/src/native_plugin.g.dart';
5-
import 'package:collection/collection.dart';
65

76
/// Convert a [NativeGraphQLResponse] to a [GraphQLResponse]
87
GraphQLRequest<String> nativeRequestToGraphQLRequest(
@@ -85,7 +84,7 @@ NativeGraphQLResponse graphQLResponseToNativeResponse(
8584
/// from a [GraphQLResponse]
8685
String _buildPayloadJson(GraphQLResponse<String> response) {
8786
final data = jsonDecode(response.data ?? '{}');
88-
final errors = response.errors.whereNotNull().map((e) => e.toJson()).toList();
87+
final errors = response.errors.nonNulls.map((e) => e.toJson()).toList();
8988
return jsonEncode({
9089
'data': data,
9190
'errors': errors,

packages/api/amplify_api_dart/lib/src/graphql/factories/graphql_request_factory.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,6 @@ class GraphQLRequestFactory {
176176
upperOutput = '(\$filter: ModelSubscription${modelName}FilterInput)';
177177
lowerOutput = r'(filter: $filter)';
178178
}
179-
default:
180-
throw const ApiOperationException(
181-
'GraphQL Request Operation is currently unsupported',
182-
recoverySuggestion: 'please use a supported GraphQL operation',
183-
);
184179
}
185180

186181
return DocumentInputs(upperOutput, lowerOutput);

packages/authenticator/amplify_authenticator/lib/src/blocs/auth/auth_bloc.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,6 @@ class StateMachineBloc
261261
}
262262
}
263263
yield* _checkUserVerification();
264-
default:
265-
break;
266264
}
267265
} on AuthNotAuthorizedException {
268266
/// The .failAuthentication flag available in the DefineAuthChallenge Lambda trigger

packages/authenticator/amplify_authenticator/lib/src/screens/authenticator_screen.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ class _FormWrapperView extends StatelessAuthenticatorComponent {
192192
form,
193193
],
194194
);
195-
break;
196195
}
197196

198197
return Padding(padding: padding, child: layout);

packages/authenticator/amplify_authenticator/lib/src/widgets/form_fields/sign_in_form_field.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ class _SignInTextFieldState extends _SignInFormFieldState<String>
159159
return (v) => state.username = v;
160160
case SignInField.password:
161161
return (v) => state.password = v;
162-
default:
163-
return super.onChanged;
164162
}
165163
}
166164

packages/aws_common/lib/src/http/aws_http_client_js.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,7 @@ class AWSHttpClientImpl extends AWSHttpClient {
7171
requestProgressController.close();
7272
},
7373
).takeUntil(cancelTrigger.future);
74-
Object body;
75-
if (request.scheme == 'http' ||
76-
supportedProtocols.supports(AlpnProtocol.http1_1)) {
77-
body = Uint8List.fromList(await collectBytes(stream));
78-
} else {
79-
body = stream;
80-
}
74+
final body = Uint8List.fromList(await collectBytes(stream));
8175

8276
if (completer.isCanceled) return;
8377
final resp = await fetch(

0 commit comments

Comments
 (0)