Skip to content

Commit

Permalink
Merge branch 'main' into test/state-machine/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Equartey authored Oct 25, 2023
2 parents f9de098 + 037dce8 commit 993bf09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import 'utils/mock_secure_storage.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('unathenticated access restricted', () {
group(
'Amplify.configure should complete even when unauthenticated access is disabled.',
() {
tearDown(Amplify.reset);

for (final environmentName in const [
Expand All @@ -34,7 +36,7 @@ void main() {
]);
await expectLater(
Amplify.configure(amplifyEnvironments[environmentName]!),
throwsA(isA<UnknownException>()),
completes,
);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ class AmplifyAnalyticsPinpointDart extends AnalyticsPluginInterface {
_endpointClient = analyticsClient.endpointClient;
_eventClient = analyticsClient.eventClient;

await _endpointClient.updateEndpoint();
try {
await _endpointClient.updateEndpoint();
} on Exception catch (e) {
_logger.warn('Could not update endpoint: $e');
}

_sessionManager = SessionManager(
fixedEndpointId: _endpointClient.fixedEndpointId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ class EventClient implements Closeable {
// Due to no internet or unable to reach server.
// These exceptions are always retryable.
eventsToDelete.clear();
} on AuthException {
// AuthException indicates request did not complete
// Due to Authentication error.
// These exceptions are always retryable.
eventsToDelete.clear();
} on SmithyHttpException catch (e) {
if (e.statusCode != null && _isRetryable(e.statusCode)) {
eventsToDelete.removeWhere((eventId, _) {
Expand Down

0 comments on commit 993bf09

Please sign in to comment.