TF-4136 Add config Sentry
This commit is contained in:
@@ -81,7 +81,6 @@ abstract class BaseController extends GetxController
|
||||
final ImagePaths imagePaths = Get.find<ImagePaths>();
|
||||
final ResponsiveUtils responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final Uuid uuid = Get.find<Uuid>();
|
||||
final ApplicationManager applicationManager = Get.find<ApplicationManager>();
|
||||
final ToastManager toastManager = Get.find<ToastManager>();
|
||||
final TwakeAppManager twakeAppManager = Get.find<TwakeAppManager>();
|
||||
|
||||
@@ -554,6 +553,7 @@ abstract class BaseController extends GetxController
|
||||
|
||||
Future<void> clearDataAndGoToLoginPage() async {
|
||||
log('$runtimeType::clearDataAndGoToLoginPage:');
|
||||
SentryManager.instance.clearUser();
|
||||
await clearAllData();
|
||||
removeAllPageAndGoToLogin();
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class AuthorizationInterceptors extends QueuedInterceptorsWrapper {
|
||||
}
|
||||
|
||||
@override
|
||||
void onError(DioError err, ErrorInterceptorHandler handler) async {
|
||||
void onError(DioException err, ErrorInterceptorHandler handler) async {
|
||||
logWarning('AuthorizationInterceptors::onError(): DIO_ERROR = $err');
|
||||
try {
|
||||
final requestOptions = err.requestOptions;
|
||||
@@ -159,7 +159,7 @@ class AuthorizationInterceptors extends QueuedInterceptorsWrapper {
|
||||
);
|
||||
if (e is ServerError || e is TemporarilyUnavailable) {
|
||||
return super.onError(
|
||||
DioError(requestOptions: err.requestOptions, error: e),
|
||||
DioException(requestOptions: err.requestOptions, error: e),
|
||||
handler,
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'dart:io';
|
||||
import 'package:core/data/model/query/query_parameter.dart';
|
||||
import 'package:core/data/network/dio_client.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:dio/dio.dart' show DioException;
|
||||
import 'package:get/get_connect/http/src/exceptions/exceptions.dart';
|
||||
import 'package:model/oidc/oidc_configuration.dart';
|
||||
import 'package:model/oidc/request/oidc_request.dart';
|
||||
@@ -14,10 +15,9 @@ import 'package:model/oidc/response/oidc_user_info.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/extensions/service_path_extension.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/network/config/oidc_constant.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/network/endpoint.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/exceptions/login_exception.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/network/oidc_error.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/exceptions/login_exception.dart';
|
||||
import 'package:tmail_ui_user/main/utils/app_config.dart';
|
||||
import 'package:dio/dio.dart' show DioError;
|
||||
|
||||
class OIDCHttpClient {
|
||||
|
||||
@@ -45,7 +45,7 @@ class OIDCHttpClient {
|
||||
} on FormatException catch (exception) {
|
||||
log('checkOIDCIsAvailable(): error while parsing server response (JSON expected): ${exception.message}');
|
||||
throw InvalidOIDCResponseException();
|
||||
} on DioError catch (exception) {
|
||||
} on DioException catch (exception) {
|
||||
if (exception.error is HandshakeException) {
|
||||
throw exception.error!;
|
||||
} else if (exception.error is SocketException) {
|
||||
|
||||
+12
-2
@@ -29,6 +29,7 @@ import 'package:jmap_dart_client/jmap/quotas/quota.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
|
||||
import 'package:rxdart/transformers.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
import 'package:server_settings/server_settings/tmail_server_settings_extension.dart';
|
||||
import 'package:tmail_ui_user/features/base/action/ui_action.dart';
|
||||
import 'package:tmail_ui_user/features/base/mixin/ai_scribe_mixin.dart';
|
||||
@@ -389,7 +390,7 @@ class MailboxDashBoardController extends ReloadableController
|
||||
_registerStreamListener();
|
||||
BackButtonInterceptor.add(onBackButtonInterceptor, name: AppRoutes.dashboard);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
await applicationManager.initUserAgent();
|
||||
await ApplicationManager().initUserAgent();
|
||||
});
|
||||
super.onInit();
|
||||
}
|
||||
@@ -868,6 +869,15 @@ class MailboxDashBoardController extends ReloadableController
|
||||
accountId.value = currentAccountId;
|
||||
synchronizeOwnEmailAddress(session.getOwnEmailAddressOrEmpty());
|
||||
|
||||
SentryManager.instance.setUser(
|
||||
SentryUser(
|
||||
id: currentAccountId.asString,
|
||||
name: session.getUserDisplayName(),
|
||||
username: session.username.value,
|
||||
email: session.getOwnEmailAddressOrEmpty(),
|
||||
)
|
||||
);
|
||||
|
||||
_setUpMinInputLengthAutocomplete();
|
||||
injectAutoCompleteBindings(session, currentAccountId);
|
||||
injectRuleFilterBindings(session, currentAccountId);
|
||||
@@ -3403,7 +3413,7 @@ class MailboxDashBoardController extends ReloadableController
|
||||
_refreshActionEventController.close();
|
||||
_notificationManager.closeStream();
|
||||
_fcmService.closeStream();
|
||||
applicationManager.releaseUserAgent();
|
||||
ApplicationManager().releaseUserAgent();
|
||||
BackButtonInterceptor.removeByName(AppRoutes.dashboard);
|
||||
_identities = null;
|
||||
outboxMailbox = null;
|
||||
|
||||
@@ -13,6 +13,7 @@ import 'package:jmap_dart_client/jmap/quotas/quota.dart';
|
||||
import 'package:model/model.dart';
|
||||
import 'package:rule_filter/rule_filter/capability_rule_filter.dart';
|
||||
import 'package:scribe/scribe/ai/presentation/utils/ai_scribe_constants.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
import 'package:server_settings/server_settings/capability_server_settings.dart';
|
||||
import 'package:tmail_ui_user/features/base/action/ui_action.dart';
|
||||
import 'package:tmail_ui_user/features/base/mixin/ai_scribe_mixin.dart';
|
||||
@@ -151,6 +152,18 @@ class ManageAccountDashBoardController extends ReloadableController
|
||||
sessionCurrent = session;
|
||||
accountId.value = session?.accountId;
|
||||
synchronizeOwnEmailAddress(session?.getOwnEmailAddressOrEmpty() ?? '');
|
||||
|
||||
if (session != null) {
|
||||
SentryManager.instance.setUser(
|
||||
SentryUser(
|
||||
id: session.accountId.asString,
|
||||
name: session.getUserDisplayName(),
|
||||
username: session.username.value,
|
||||
email: session.getOwnEmailAddressOrEmpty(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_setUpMinInputLengthAutocomplete();
|
||||
_bindingInteractorForMenuItemView(sessionCurrent, accountId.value);
|
||||
_getVacationResponse();
|
||||
|
||||
@@ -147,8 +147,8 @@ class FileUploader {
|
||||
resultJson: resultJson,
|
||||
fileName: argsUpload.fileInfo.fileName);
|
||||
}
|
||||
} on DioError catch (exception) {
|
||||
logWarning('FileUploader::_handleUploadAttachmentAction():DioError: $exception');
|
||||
} on DioException catch (exception) {
|
||||
logWarning('FileUploader::_handleUploadAttachmentAction():DioException: $exception');
|
||||
|
||||
throw exception.copyWith(
|
||||
requestOptions: exception.requestOptions.copyWith(data: ''));
|
||||
|
||||
@@ -62,7 +62,7 @@ class UploadAttachment with EquatableMixin {
|
||||
_updateEvent(Right(SuccessAttachmentUploadState(uploadTaskId, attachment, fileInfo)));
|
||||
} catch (error, stackTrace) {
|
||||
logWarning('UploadAttachment::upload():ERROR: $error');
|
||||
if (error is DioError && error.type == DioErrorType.cancel) {
|
||||
if (error is DioException && error.type == DioExceptionType.cancel) {
|
||||
_updateEvent(Left(CancelAttachmentUploadState(uploadTaskId)));
|
||||
} else {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user