diff --git a/auth/flutter b/auth/flutter index 41456452f2..ba39319843 160000 --- a/auth/flutter +++ b/auth/flutter @@ -1 +1 @@ -Subproject commit 41456452f29d64e8deb623a3c927524bcf9f111b +Subproject commit ba393198430278b6595976de84fe170f553cc728 diff --git a/auth/lib/core/network.dart b/auth/lib/core/network.dart index f9d3af41e5..f12172891a 100644 --- a/auth/lib/core/network.dart +++ b/auth/lib/core/network.dart @@ -2,12 +2,12 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:ente_auth/core/configuration.dart'; -import 'package:ente_auth/core/constants.dart'; +import 'package:ente_auth/core/event_bus.dart'; +import 'package:ente_auth/events/endpoint_updated_event.dart'; import 'package:ente_auth/utils/package_info_util.dart'; import 'package:ente_auth/utils/platform_util.dart'; import 'package:fk_user_agent/fk_user_agent.dart'; import 'package:flutter/foundation.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import 'package:uuid/uuid.dart'; int kConnectTimeout = 15000; @@ -22,8 +22,6 @@ class Network { final version = PackageInfoUtil().getVersion(packageInfo); final packageName = PackageInfoUtil().getPackageName(packageInfo); - final preferences = await SharedPreferences.getInstance(); - _dio = Dio( BaseOptions( connectTimeout: Duration(milliseconds: kConnectTimeout), @@ -39,7 +37,7 @@ class Network { _enteDio = Dio( BaseOptions( - baseUrl: apiEndpoint, + baseUrl: Configuration.endpoint, connectTimeout: Duration(milliseconds: kConnectTimeout), headers: { if (PlatformUtil.isMobile()) @@ -51,7 +49,7 @@ class Network { }, ), ); - _setupInterceptors(endpoint); + _setupInterceptors(Configuration.endpoint); Bus.instance.on().listen((event) { final endpoint = Configuration.instance.getHttpEndpoint(); diff --git a/auth/lib/main.dart b/auth/lib/main.dart index 3eb7a1bcbc..0c9dc7887f 100644 --- a/auth/lib/main.dart +++ b/auth/lib/main.dart @@ -42,7 +42,7 @@ void main() async { WindowOptions windowOptions = const WindowOptions( size: Size(450, 800), ); - windowManager.waitUntilReadyToShow(windowOptions, () async { + await windowManager.waitUntilReadyToShow(windowOptions, () async { await windowManager.show(); await windowManager.focus(); }); diff --git a/auth/lib/services/authenticator_service.dart b/auth/lib/services/authenticator_service.dart index 5788294b96..ee0ad32bd4 100644 --- a/auth/lib/services/authenticator_service.dart +++ b/auth/lib/services/authenticator_service.dart @@ -210,7 +210,7 @@ class AuthenticatorService { await _db.deleteByIDs(ids: deletedIDs); } await _prefs.setInt(_lastEntitySyncTime, maxSyncTime); - _logger.info("Setting synctime to " + maxSyncTime.toString()); + _logger.info("Setting synctime to $maxSyncTime"); if (result.length == fetchLimit) { _logger.info("Diff limit reached, pulling again"); await _remoteToLocalSync(); diff --git a/auth/lib/services/notification_service.dart b/auth/lib/services/notification_service.dart index ce4bc536f5..63410eb7db 100644 --- a/auth/lib/services/notification_service.dart +++ b/auth/lib/services/notification_service.dart @@ -27,7 +27,7 @@ class NotificationService { _flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation< AndroidFlutterLocalNotificationsPlugin>(); if (implementation != null) { - implementation.requestNotificationsPermission(); + await implementation.requestNotificationsPermission(); } } diff --git a/auth/lib/ui/account/login_page.dart b/auth/lib/ui/account/login_page.dart index a1c3fe727b..5b8aa0daa2 100644 --- a/auth/lib/ui/account/login_page.dart +++ b/auth/lib/ui/account/login_page.dart @@ -26,7 +26,7 @@ class _LoginPageState extends State { final Logger _logger = Logger('_LoginPageState'); Future onPressed() async { - UserService.instance.setEmail(_email!); + await UserService.instance.setEmail(_email!); Configuration.instance.resetVolatilePassword(); SrpAttributes? attr; bool isEmailVerificationEnabled = true; @@ -39,7 +39,7 @@ class _LoginPageState extends State { } } if (attr != null && !isEmailVerificationEnabled) { - Navigator.of(context).push( + await Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) { return LoginPasswordVerificationPage( diff --git a/auth/lib/ui/account/recovery_key_page.dart b/auth/lib/ui/account/recovery_key_page.dart index 1b971b730b..a74b2daeca 100644 --- a/auth/lib/ui/account/recovery_key_page.dart +++ b/auth/lib/ui/account/recovery_key_page.dart @@ -254,7 +254,7 @@ class _RecoveryKeyPageState extends State { childrens.add( GradientButton( onTap: () async { - shareDialog( + await shareDialog( context, context.l10n.recoveryKey, saveAction: () async { diff --git a/auth/lib/ui/account/recovery_page.dart b/auth/lib/ui/account/recovery_page.dart index 74749564dc..137b8ce437 100644 --- a/auth/lib/ui/account/recovery_page.dart +++ b/auth/lib/ui/account/recovery_page.dart @@ -24,7 +24,7 @@ class _RecoveryPageState extends State { await Configuration.instance.recover(_recoveryKey.text.trim()); await dialog.hide(); showToast(context, "Recovery successful!"); - Navigator.of(context).pushReplacement( + await Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (BuildContext context) { return const PopScope( @@ -42,7 +42,7 @@ class _RecoveryPageState extends State { if (e is AssertionError) { errMessage = '$errMessage : ${e.message}'; } - showErrorDialog(context, "Incorrect recovery key", errMessage); + await showErrorDialog(context, "Incorrect recovery key", errMessage); } } diff --git a/auth/lib/ui/account/verify_recovery_page.dart b/auth/lib/ui/account/verify_recovery_page.dart index 06d489b4a8..03ed81fdf0 100644 --- a/auth/lib/ui/account/verify_recovery_page.dart +++ b/auth/lib/ui/account/verify_recovery_page.dart @@ -94,7 +94,7 @@ class _VerifyRecoveryPageState extends State { try { recoveryKey = CryptoUtil.bin2hex(Configuration.instance.getRecoveryKey()); - routeToPage( + await routeToPage( context, RecoveryKeyPage( recoveryKey, diff --git a/auth/lib/ui/home_page.dart b/auth/lib/ui/home_page.dart index d543d1248a..12c8df5d8a 100644 --- a/auth/lib/ui/home_page.dart +++ b/auth/lib/ui/home_page.dart @@ -158,7 +158,7 @@ class _HomePageState extends State { Navigator.of(context).pop(); return; } - MoveToBackground.moveTaskToBack(); + await MoveToBackground.moveTaskToBack(); }, canPop: false, child: Scaffold( diff --git a/auth/lib/ui/settings/data/data_section_widget.dart b/auth/lib/ui/settings/data/data_section_widget.dart index db3d2aae27..f32739d239 100644 --- a/auth/lib/ui/settings/data/data_section_widget.dart +++ b/auth/lib/ui/settings/data/data_section_widget.dart @@ -37,7 +37,7 @@ class DataSectionWidget extends StatelessWidget { trailingIcon: Icons.chevron_right_outlined, trailingIconIsMuted: true, onTap: () async { - routeToPage(context, const ImportCodePage()); + await routeToPage(context, const ImportCodePage()); }, ), sectionOptionSpacing, diff --git a/auth/lib/ui/settings/developer_settings_page.dart b/auth/lib/ui/settings/developer_settings_page.dart index 96139e9827..1a42839637 100644 --- a/auth/lib/ui/settings/developer_settings_page.dart +++ b/auth/lib/ui/settings/developer_settings_page.dart @@ -27,7 +27,7 @@ class _DeveloperSettingsPageState extends State { @override Widget build(BuildContext context) { _logger.info( - "Current endpoint is: " + Configuration.instance.getHttpEndpoint(), + "Current endpoint is: ${Configuration.instance.getHttpEndpoint()}", ); return Scaffold( appBar: AppBar( @@ -49,7 +49,7 @@ class _DeveloperSettingsPageState extends State { GradientButton( onTap: () async { String url = _urlController.text; - _logger.info("Entered endpoint: " + url); + _logger.info("Entered endpoint: $url"); try { final uri = Uri.parse(url); if ((uri.scheme == "http" || uri.scheme == "https")) { @@ -79,7 +79,7 @@ class _DeveloperSettingsPageState extends State { Future _ping(String endpoint) async { try { - final response = await Dio().get(endpoint + '/ping'); + final response = await Dio().get('$endpoint/ping'); if (response.data['message'] != 'pong') { throw Exception('Invalid response'); } diff --git a/auth/lib/ui/settings/developer_settings_widget.dart b/auth/lib/ui/settings/developer_settings_widget.dart index 0fb32301ca..32f05f929d 100644 --- a/auth/lib/ui/settings/developer_settings_widget.dart +++ b/auth/lib/ui/settings/developer_settings_widget.dart @@ -15,7 +15,7 @@ class DeveloperSettingsWidget extends StatelessWidget { padding: const EdgeInsets.only(bottom: 20), child: Text( context.l10n.customEndpoint( - endpointURI.host + ":" + endpointURI.port.toString(), + "${endpointURI.host}:${endpointURI.port}", ), style: Theme.of(context).textTheme.bodySmall, ), diff --git a/auth/lib/utils/email_util.dart b/auth/lib/utils/email_util.dart index 7679dbf91e..a531d9ee25 100644 --- a/auth/lib/utils/email_util.dart +++ b/auth/lib/utils/email_util.dart @@ -42,7 +42,7 @@ Future sendLogs( String? body, }) async { final l10n = context.l10n; - showDialogWidget( + await showDialogWidget( context: context, title: title, icon: Icons.bug_report_outlined, @@ -68,7 +68,7 @@ Future sendLogs( labelText: l10n.viewLogsAction, buttonAction: ButtonAction.second, onTap: () async { - showDialog( + await showDialog( context: context, builder: (BuildContext context) { return LogFileViewer(SuperLogging.logFile!); @@ -101,71 +101,14 @@ Future sendLogs( ); }, ), - onPressed: () async { - // ignore: unawaited_futures - showDialog( - context: context, - builder: (BuildContext context) { - return LogFileViewer(SuperLogging.logFile!); - }, - barrierColor: Colors.black87, - barrierDismissible: false, - ); - }, - ), - TextButton( - child: Text( - title, - style: TextStyle( - color: Theme.of(context).colorScheme.alternativeColor, - ), - ), - onPressed: () async { - Navigator.of(context, rootNavigator: true).pop('dialog'); - await _sendLogs(context, toEmail, subject, body); - if (postShare != null) { - postShare(); - } - }, - ), - ]; - final List content = []; - content.addAll( - [ - Text( - l10n.sendLogsDescription, - style: const TextStyle( - height: 1.5, - fontSize: 16, - ), - ), - const Padding(padding: EdgeInsets.all(12)), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: actions, + ButtonWidget( + isInAlert: true, + buttonType: ButtonType.secondary, + labelText: l10n.cancel, + buttonAction: ButtonAction.cancel, ), ], ); - final confirmation = AlertDialog( - title: Text( - title, - style: const TextStyle( - fontSize: 18, - ), - ), - content: SingleChildScrollView( - child: ListBody( - children: content, - ), - ), - ); - // ignore: unawaited_futures - showDialog( - context: context, - builder: (_) { - return confirmation; - }, - ); } Future _sendLogs( diff --git a/auth/lib/utils/platform_util.dart b/auth/lib/utils/platform_util.dart index 7f69f08798..5e02702579 100644 --- a/auth/lib/utils/platform_util.dart +++ b/auth/lib/utils/platform_util.dart @@ -32,7 +32,7 @@ class PlatformUtil { static openWebView(BuildContext context, String title, String url) async { if (PlatformUtil.isDesktop()) { if (!await WebviewWindow.isWebviewAvailable()) { - launchUrlString(url); + await launchUrlString(url); return; } @@ -44,7 +44,7 @@ class PlatformUtil { webview.launch(url); return; } - Navigator.of(context).push( + await Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) { return WebPage( diff --git a/auth/lib/utils/share_utils.dart b/auth/lib/utils/share_utils.dart index 32e779ea39..5bb8e08480 100644 --- a/auth/lib/utils/share_utils.dart +++ b/auth/lib/utils/share_utils.dart @@ -13,7 +13,7 @@ Future shareDialog( required Function sendAction, }) async { final l10n = context.l10n; - showDialogWidget( + await showDialogWidget( context: context, title: title, body: Platform.isLinux || Platform.isWindows diff --git a/auth/pubspec.lock b/auth/pubspec.lock index 059e4eb38b..dc405562ba 100644 --- a/auth/pubspec.lock +++ b/auth/pubspec.lock @@ -213,7 +213,7 @@ packages: dependency: "direct main" description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted version: "1.18.0" @@ -901,26 +901,26 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" mime: dependency: transitive description: @@ -969,14 +969,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.0" - open_filex: - dependency: "direct main" - description: - name: open_filex - sha256: "74e2280754cf8161e860746c3181db2c996d6c1909c7057b738ede4a469816b8" - url: "https://pub.dev" - source: hosted - version: "4.4.0" otp: dependency: "direct main" description: @@ -1021,10 +1013,10 @@ packages: dependency: "direct main" description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_drawing: dependency: transitive description: @@ -1419,10 +1411,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" step_progress_indicator: dependency: "direct main" description: @@ -1435,10 +1427,10 @@ packages: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1483,7 +1475,7 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted version: "0.6.1" @@ -1643,10 +1635,10 @@ packages: dependency: transitive description: name: vm_service - sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 url: "https://pub.dev" source: hosted - version: "11.10.0" + version: "13.0.0" watcher: dependency: transitive description: diff --git a/desktop/thirdparty/next-electron-server b/desktop/thirdparty/next-electron-server new file mode 160000 index 0000000000..a88030295c --- /dev/null +++ b/desktop/thirdparty/next-electron-server @@ -0,0 +1 @@ +Subproject commit a88030295c89dd8f43d9e3a45025678d95c78a45 diff --git a/mobile/thirdparty/flutter b/mobile/thirdparty/flutter new file mode 160000 index 0000000000..367f9ea16b --- /dev/null +++ b/mobile/thirdparty/flutter @@ -0,0 +1 @@ +Subproject commit 367f9ea16bfae1ca451b9cc27c1366870b187ae2 diff --git a/mobile/thirdparty/isar b/mobile/thirdparty/isar new file mode 160000 index 0000000000..6643d064ab --- /dev/null +++ b/mobile/thirdparty/isar @@ -0,0 +1 @@ +Subproject commit 6643d064abf22606b6c6a741ea873e4781115ef4