Skip to content

Commit

Permalink
Prevents spurious error on integration test
Browse files Browse the repository at this point in the history
It appears that the agent is crashing.
GrpcError might be thrown before post-morten tests complete.
Integration tests report error when such happens.
  • Loading branch information
CarlosNihelton committed Sep 6, 2023
1 parent c5cabcc commit a269734
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion gui/packages/ubuntupro/lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:agentapi/agentapi.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:grpc/grpc.dart';
import 'package:provider/provider.dart';
import 'package:ubuntu_service/ubuntu_service.dart';
import 'package:yaru/yaru.dart';
Expand Down Expand Up @@ -39,7 +40,13 @@ class Pro4WindowsApp extends StatelessWidget {
registerServiceInstance<AgentApiClient>(client);
final subscriptionInfo =
context.read<ValueNotifier<SubscriptionInfo>>();
subscriptionInfo.value = await client.subscriptionInfo();
// TODO: Remove this try-catch once the agent stop crashing due lack of MS Store access
try {
subscriptionInfo.value = await client.subscriptionInfo();
} on GrpcError catch (err) {
debugPrint('$err');
debugPrintStack(maxFrames: 20);
}
},
),
child: const StartupPage(nextRoute: Routes.subscriptionStatus),
Expand Down
1 change: 0 additions & 1 deletion gui/packages/ubuntupro/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

import 'app.dart';

Future<void> main() async {
Expand Down

0 comments on commit a269734

Please sign in to comment.