diff --git a/android/build.gradle b/android/build.gradle index 564be697d..d9d8be9d8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,9 +8,8 @@ buildscript { ext.appCompatVersion = '1.1.0' // for background_fetch dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.android.tools.build:gradle:3.3.1' // for background_fetch + classpath 'com.android.tools.build:gradle:4.0.1' // for background_fetch } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b7..493072b3c 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/lib/core/cache/thumbnail_cache_manager.dart b/lib/core/cache/thumbnail_cache_manager.dart index 91e9203e0..9be732afe 100644 --- a/lib/core/cache/thumbnail_cache_manager.dart +++ b/lib/core/cache/thumbnail_cache_manager.dart @@ -1,22 +1,11 @@ import 'package:flutter_cache_manager/flutter_cache_manager.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:path/path.dart' as p; -class ThumbnailCacheManager extends BaseCacheManager { +class ThumbnailCacheManager { static const key = 'cached-thumbnail-data'; - - static ThumbnailCacheManager _instance; - - factory ThumbnailCacheManager() { - _instance ??= ThumbnailCacheManager._(); - return _instance; - } - - ThumbnailCacheManager._() : super(key, maxNrOfCacheObjects: 2500); - - @override - Future getFilePath() async { - var directory = await getTemporaryDirectory(); - return p.join(directory.path, key); - } + static CacheManager instance = CacheManager( + Config( + key, + maxNrOfCacheObjects: 2500, + ), + ); } diff --git a/lib/core/cache/video_cache_manager.dart b/lib/core/cache/video_cache_manager.dart index 95df78e48..feee25a13 100644 --- a/lib/core/cache/video_cache_manager.dart +++ b/lib/core/cache/video_cache_manager.dart @@ -1,22 +1,12 @@ import 'package:flutter_cache_manager/flutter_cache_manager.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:path/path.dart' as p; -class VideoCacheManager extends BaseCacheManager { +class VideoCacheManager { static const key = 'cached-video-data'; - static VideoCacheManager _instance; - - factory VideoCacheManager() { - _instance ??= VideoCacheManager._(); - return _instance; - } - - VideoCacheManager._() : super(key, maxNrOfCacheObjects: 50); - - @override - Future getFilePath() async { - var directory = await getTemporaryDirectory(); - return p.join(directory.path, key); - } + static CacheManager instance = CacheManager( + Config( + key, + maxNrOfCacheObjects: 50, + ), + ); } diff --git a/lib/events/tab_changed_event.dart b/lib/events/tab_changed_event.dart index 6cfa330c2..698b2fcc0 100644 --- a/lib/events/tab_changed_event.dart +++ b/lib/events/tab_changed_event.dart @@ -1,4 +1,4 @@ -import 'package:sentry/sentry.dart'; +import 'package:photos/events/event.dart'; class TabChangedEvent extends Event { final int selectedIndex; diff --git a/lib/services/sync_service.dart b/lib/services/sync_service.dart index a01b8cf65..d4486523e 100644 --- a/lib/services/sync_service.dart +++ b/lib/services/sync_service.dart @@ -120,11 +120,12 @@ class SyncService { _logger.info("Logging user out"); Bus.instance.fire(TriggerLogoutEvent()); } catch (e, s) { - if (e is DioError && - e.type == DioErrorType.DEFAULT && - e.error.osError != null) { - final errorCode = e.error.osError?.errorCode; - if (errorCode == 111 || errorCode == 101 || errorCode == 7) { + if (e is DioError) { + if (e.type == DioErrorType.connectTimeout || + e.type == DioErrorType.sendTimeout || + e.type == DioErrorType.receiveTimeout || + e.type == DioErrorType.cancel || + e.type == DioErrorType.other) { Bus.instance.fire(SyncStatusUpdate(SyncStatus.paused, reason: "waiting for network...")); return false; diff --git a/lib/ui/settings/support_section_widget.dart b/lib/ui/settings/support_section_widget.dart index c259b2ebf..72a38ef4d 100644 --- a/lib/ui/settings/support_section_widget.dart +++ b/lib/ui/settings/support_section_widget.dart @@ -109,14 +109,15 @@ class CrispChatPage extends StatefulWidget { class _CrispChatPageState extends State { static const websiteID = "86d56ea2-68a2-43f9-8acb-95e06dee42e8"; + CrispMain _crisp; @override void initState() { - crisp.initialize( + _crisp = CrispMain( websiteId: websiteID, ); - crisp.register( - CrispUser( + _crisp.register( + user: CrispUser( email: Configuration.instance.getEmail(), ), ); @@ -130,6 +131,7 @@ class _CrispChatPageState extends State { title: Text("support chat"), ), body: CrispView( + crispMain: _crisp, loadingWidget: loadWidget, ), ); diff --git a/lib/ui/web_page.dart b/lib/ui/web_page.dart index fed7b0099..5549c74a0 100644 --- a/lib/ui/web_page.dart +++ b/lib/ui/web_page.dart @@ -23,7 +23,7 @@ class _WebPageState extends State { actions: [_hasLoadedPage ? Container() : loadWidget], ), body: InAppWebView( - initialUrl: widget.url, + initialUrlRequest: URLRequest(url: Uri.parse(widget.url)), onLoadStop: (c, url) { setState(() { _hasLoadedPage = true; diff --git a/lib/utils/file_util.dart b/lib/utils/file_util.dart index 3736a0f3f..3a815540a 100644 --- a/lib/utils/file_util.dart +++ b/lib/utils/file_util.dart @@ -91,8 +91,8 @@ Future deleteFilesFromEverywhere( } } if (deletedFiles.isNotEmpty) { - Bus.instance.fire(LocalPhotosUpdatedEvent(deletedFiles, - type: EventType.deleted)); + Bus.instance + .fire(LocalPhotosUpdatedEvent(deletedFiles, type: EventType.deleted)); } await dialog.hide(); showToast("deleted from everywhere"); @@ -123,8 +123,8 @@ Future deleteFilesOnDeviceOnly( } } if (deletedFiles.isNotEmpty) { - Bus.instance.fire(LocalPhotosUpdatedEvent(deletedFiles, - type: EventType.deleted)); + Bus.instance + .fire(LocalPhotosUpdatedEvent(deletedFiles, type: EventType.deleted)); } await dialog.hide(); } @@ -224,7 +224,7 @@ enum DownloadStatus { Future getFileFromServer(File file, {ProgressCallback progressCallback}) async { final cacheManager = file.fileType == FileType.video - ? VideoCacheManager() + ? VideoCacheManager.instance : DefaultCacheManager(); return cacheManager.getFileFromCache(file.getDownloadUrl()).then((info) { if (info == null) { @@ -243,7 +243,7 @@ Future getFileFromServer(File file, } Future getThumbnailFromServer(File file) async { - return ThumbnailCacheManager() + return ThumbnailCacheManager.instance .getFileFromCache(file.getThumbnailUrl()) .then((info) { if (info == null) { @@ -390,7 +390,7 @@ Future _downloadAndDecryptThumbnail(File file) async { data.length.toString()); } encryptedFile.deleteSync(); - final cachedThumbnail = ThumbnailCacheManager().putFile( + final cachedThumbnail = ThumbnailCacheManager.instance.putFile( file.getThumbnailUrl(), data, eTag: file.getThumbnailUrl(), @@ -418,9 +418,9 @@ Future compressThumbnail(Uint8List thumbnail) { void clearCache(File file) { if (file.fileType == FileType.video) { - VideoCacheManager().removeFile(file.getDownloadUrl()); + VideoCacheManager.instance.removeFile(file.getDownloadUrl()); } else { DefaultCacheManager().removeFile(file.getDownloadUrl()); } - ThumbnailCacheManager().removeFile(file.getThumbnailUrl()); + ThumbnailCacheManager.instance.removeFile(file.getThumbnailUrl()); } diff --git a/pubspec.lock b/pubspec.lock index 9ba67c3d8..caa78b4b1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,14 +14,14 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "3.1.2" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.6.0" + version: "2.0.0" async: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: background_fetch url: "https://pub.dartlang.org" source: hosted - version: "0.7.1" + version: "0.7.2" boolean_selector: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: cached_network_image url: "https://pub.dartlang.org" source: hosted - version: "2.3.3" + version: "3.0.0" characters: dependency: transitive description: @@ -98,49 +98,56 @@ packages: name: connectivity url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.3" connectivity_for_web: dependency: transitive description: name: connectivity_for_web url: "https://pub.dartlang.org" source: hosted - version: "0.3.1+4" + version: "0.4.0" connectivity_macos: dependency: transitive description: name: connectivity_macos url: "https://pub.dartlang.org" source: hosted - version: "0.1.0+7" + version: "0.2.0" connectivity_platform_interface: dependency: transitive description: name: connectivity_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.6" - convert: + version: "2.0.1" + contact_picker_platform_interface: dependency: transitive description: - name: convert + name: contact_picker_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "4.4.0" + contact_picker_web: + dependency: transitive + description: + name: contact_picker_web + url: "https://pub.dartlang.org" + source: hosted + version: "4.4.0" crisp: dependency: "direct main" description: name: crisp url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "3.0.1" cupertino_icons: dependency: "direct main" description: @@ -154,35 +161,21 @@ packages: name: device_info url: "https://pub.dartlang.org" source: hosted - version: "0.4.2+10" - device_info_platform_interface: - dependency: transitive - description: - name: device_info_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" + version: "0.4.2+6" dio: dependency: "direct main" description: name: dio url: "https://pub.dartlang.org" source: hosted - version: "3.0.10" - draggable_scrollbar: - dependency: "direct main" - description: - name: draggable_scrollbar - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4" + version: "4.0.0" event_bus: dependency: "direct main" description: name: event_bus url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "2.0.0" expansion_card: dependency: "direct main" description: @@ -203,7 +196,7 @@ packages: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "1.0.0" file: dependency: transitive description: @@ -222,21 +215,21 @@ packages: name: flutter_blurhash url: "https://pub.dartlang.org" source: hosted - version: "0.5.0" + version: "0.6.0" flutter_cache_manager: dependency: "direct main" description: name: flutter_cache_manager url: "https://pub.dartlang.org" source: hosted - version: "1.4.2" + version: "3.0.1" flutter_email_sender: dependency: "direct main" description: name: flutter_email_sender url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "5.0.0" flutter_image_compress: dependency: "direct main" description: @@ -250,49 +243,35 @@ packages: name: flutter_inappwebview url: "https://pub.dartlang.org" source: hosted - version: "4.0.0+4" + version: "5.3.2" flutter_keyboard_visibility: dependency: transitive description: name: flutter_keyboard_visibility url: "https://pub.dartlang.org" source: hosted - version: "4.0.2" - flutter_keyboard_visibility_platform_interface: - dependency: transitive - description: - name: flutter_keyboard_visibility_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_keyboard_visibility_web: - dependency: transitive - description: - name: flutter_keyboard_visibility_web - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" + version: "3.3.0" flutter_launcher_icons: dependency: "direct dev" description: name: flutter_launcher_icons url: "https://pub.dartlang.org" source: hosted - version: "0.8.0" + version: "0.9.0" flutter_native_splash: dependency: "direct dev" description: name: flutter_native_splash url: "https://pub.dartlang.org" source: hosted - version: "0.2.9" + version: "1.1.8+4" flutter_password_strength: dependency: "direct main" description: name: flutter_password_strength url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.1.6" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -306,14 +285,14 @@ packages: name: flutter_secure_storage url: "https://pub.dartlang.org" source: hosted - version: "3.3.5" + version: "4.2.0" flutter_sodium: dependency: "direct main" description: name: flutter_sodium url: "https://pub.dartlang.org" source: hosted - version: "0.1.10" + version: "0.2.0" flutter_test: dependency: "direct dev" description: flutter @@ -325,7 +304,7 @@ packages: name: flutter_typeahead url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.8.8" flutter_user_agent: dependency: "direct main" description: @@ -338,13 +317,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_webview_plugin: - dependency: transitive - description: - name: flutter_webview_plugin - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.11" flutter_windowmanager: dependency: "direct main" description: @@ -358,42 +330,42 @@ packages: name: fluttercontactpicker url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "4.4.0" fluttertoast: dependency: "direct main" description: name: fluttertoast url: "https://pub.dartlang.org" source: hosted - version: "7.1.6" + version: "8.0.6" google_nav_bar: dependency: "direct main" description: name: google_nav_bar url: "https://pub.dartlang.org" source: hosted - version: "4.0.2" + version: "5.0.5" http: dependency: transitive description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.2" + version: "0.13.2" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "3.1.4" + version: "4.0.0" image: dependency: "direct main" description: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.1.19" + version: "3.0.2" in_app_purchase: dependency: "direct main" description: @@ -428,7 +400,7 @@ packages: name: like_button url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "2.0.2" local_auth: dependency: "direct main" description: @@ -463,56 +435,56 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "0.9.7" + version: "1.0.0" octo_image: dependency: transitive description: name: octo_image url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "1.0.0+1" package_info_plus: dependency: "direct main" description: name: package_info_plus url: "https://pub.dartlang.org" source: hosted - version: "0.6.4" + version: "1.0.1" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux url: "https://pub.dartlang.org" source: hosted - version: "0.1.1" + version: "1.0.1" package_info_plus_macos: dependency: transitive description: name: package_info_plus_macos url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "1.1.1" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "1.0.1" package_info_plus_web: dependency: transitive description: name: package_info_plus_web url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "1.0.1" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "1.0.1" page_transition: dependency: "direct main" description: @@ -533,49 +505,49 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.27" + version: "2.0.1" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+2" + version: "2.0.0" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+8" + version: "2.0.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+3" + version: "2.0.1" pedantic: dependency: "direct main" description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.9.2" + version: "1.11.0" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "4.1.0" photo_manager: dependency: "direct main" description: @@ -589,7 +561,7 @@ packages: name: photo_view url: "https://pub.dartlang.org" source: hosted - version: "0.9.2" + version: "0.11.1" platform: dependency: transitive description: @@ -597,27 +569,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.0" - platform_detect: - dependency: transitive - description: - name: platform_detect - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" - pretty_dio_logger: - dependency: "direct main" - description: - name: pretty_dio_logger - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" + version: "2.0.0" process: dependency: transitive description: @@ -632,13 +590,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.2.0" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" quiver: dependency: "direct main" description: @@ -652,7 +603,7 @@ packages: name: rxdart url: "https://pub.dartlang.org" source: hosted - version: "0.24.1" + version: "0.26.0" scrollable_positioned_list: dependency: "direct main" description: @@ -666,56 +617,56 @@ packages: name: sentry url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "5.0.0" share: dependency: "direct main" description: name: share url: "https://pub.dartlang.org" source: hosted - version: "0.6.5+4" + version: "2.0.1" shared_preferences: dependency: "direct main" description: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.12+4" + version: "2.0.5" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+4" + version: "2.0.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+11" + version: "2.0.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.2+7" + version: "2.0.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+2" + version: "2.0.0" sky_engine: dependency: transitive description: flutter @@ -734,21 +685,21 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "1.3.1+2" + version: "2.0.0+3" sqflite_common: dependency: transitive description: name: sqflite_common url: "https://pub.dartlang.org" source: hosted - version: "1.0.3+1" + version: "2.0.0+2" sqflite_migration: dependency: "direct main" description: name: sqflite_migration url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.3.0" stack_trace: dependency: transitive description: @@ -783,7 +734,7 @@ packages: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "2.2.0+2" + version: "3.0.0" term_glyph: dependency: transitive description: @@ -811,63 +762,77 @@ packages: name: uni_links url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.5.1" + uni_links_platform_interface: + dependency: transitive + description: + name: uni_links_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + uni_links_web: + dependency: transitive + description: + name: uni_links_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" + universal_io: + dependency: transitive + description: + name: universal_io + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.7.10" + version: "6.0.3" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+4" + version: "2.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+9" + version: "2.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "2.0.2" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.5+1" + version: "2.0.0" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+3" - usage: - dependency: transitive - description: - name: usage - url: "https://pub.dartlang.org" - source: hosted - version: "3.4.2" + version: "2.0.0" uuid: dependency: transitive description: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "2.2.2" + version: "3.0.4" vector_math: dependency: transitive description: @@ -937,28 +902,28 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "1.7.4" + version: "2.0.5" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.2.0" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "4.5.1" + version: "5.1.0" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.2.1" + version: "3.1.0" sdks: dart: ">=2.12.0 <3.0.0" flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 9008b01b5..b6ea9e396 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,55 +25,53 @@ dependencies: cupertino_icons: ^1.0.0 photo_manager: ^1.0.6 provider: ^3.1.0 - sqflite: ^1.3.0 - sqflite_migration: ^0.2.0 - path_provider: ^1.6.5 - shared_preferences: ^0.5.6 - dio: ^3.0.9 - image: ^2.1.4 - share: ^0.6.5+4 - draggable_scrollbar: ^0.0.4 - photo_view: ^0.9.2 + sqflite: ^2.0.0+3 + sqflite_migration: ^0.3.0 + path_provider: ^2.0.1 + shared_preferences: ^2.0.5 + dio: ^4.0.0 + image: ^3.0.2 + share: ^2.0.1 + photo_view: ^0.11.1 visibility_detector: ^0.2.0 - event_bus: ^1.1.1 - sentry: ">=3.0.0 <4.0.0" + event_bus: ^2.0.0 + sentry: ^5.0.0 super_logging: path: thirdparty/super_logging - archive: ^2.0.11 - flutter_email_sender: ^3.0.1 - like_button: ^0.2.0 + archive: ^3.1.2 + flutter_email_sender: ^5.0.0 + like_button: ^2.0.2 logging: ^0.11.4 flutter_image_compress: path: thirdparty/flutter_image_compress flutter_typeahead: ^1.8.1 - fluttertoast: ^7.1.5 + fluttertoast: ^8.0.6 video_player: ^2.0.0 chewie: ^1.0.0 - cached_network_image: ^2.3.0-beta + cached_network_image: ^3.0.0 animate_do: ^1.7.2 - flutter_cache_manager: ^1.4.1 + flutter_cache_manager: ^3.0.1 computer: ^1.0.2 - flutter_secure_storage: ^3.3.3 - uni_links: ^0.4.0 + flutter_secure_storage: ^4.2.0 + uni_links: ^0.5.1 crisp: ^0.1.3 - flutter_sodium: ^0.1.8 + flutter_sodium: ^0.2.0 pedantic: ^1.9.2 page_transition: "^1.1.7+2" scrollable_positioned_list: ^0.1.8 - connectivity: ^2.0.1 - pretty_dio_logger: ^1.1.1 - url_launcher: ^5.7.10 - fluttercontactpicker: ^3.1.0 + connectivity: ^3.0.3 + url_launcher: ^6.0.3 + fluttercontactpicker: ^4.4.0 in_app_purchase: path: thirdparty/in_app_purchase expansion_card: ^0.1.0 - flutter_password_strength: ^0.1.4 - flutter_inappwebview: ^4.0.0+4 - background_fetch: ^0.7.1 + flutter_password_strength: ^0.1.6 + flutter_inappwebview: ^5.3.2 + background_fetch: ^0.7.2 # flutter_inapp_purchase: ^3.0.1 - google_nav_bar: ^4.0.2 - package_info_plus: ^0.6.4 - local_auth: ^1.1.0 + google_nav_bar: ^5.0.5 + package_info_plus: ^1.0.1 + local_auth: ^1.1.5 flutter_windowmanager: ^0.0.2 flutter_user_agent: ^1.2.2 quiver: ^3.0.1 @@ -81,8 +79,8 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_launcher_icons: "0.8.0" - flutter_native_splash: ^0.2.9 + flutter_launcher_icons: "0.9.0" + flutter_native_splash: ^1.1.8+4 flutter_icons: android: true diff --git a/thirdparty/super_logging/lib/super_logging.dart b/thirdparty/super_logging/lib/super_logging.dart index e4e97b6c1..b8f9790dd 100644 --- a/thirdparty/super_logging/lib/super_logging.dart +++ b/thirdparty/super_logging/lib/super_logging.dart @@ -12,8 +12,6 @@ import 'package:path/path.dart'; import 'package:path_provider/path_provider.dart'; import 'package:sentry/sentry.dart'; -export 'package:sentry/sentry.dart' show User; - typedef FutureOr FutureOrVoidCallback(); extension SuperString on String { @@ -52,17 +50,6 @@ extension SuperLogRecord on LogRecord { return msg; } - - Event toEvent({String appVersion}) { - return Event( - release: appVersion, - level: SeverityLevel.error, - culprit: message, - loggerName: loggerName, - exception: error, - stackTrace: stackTrace, - ); - } } class LogConfig { @@ -205,7 +192,7 @@ class SuperLogging { static void _sendErrorToSentry(Object error, StackTrace stack) { try { sentryClient.captureException( - exception: error, + error, stackTrace: stack, ); $.info('Error sent to sentry.io: $error'); @@ -240,8 +227,7 @@ class SuperLogging { // add error to sentry queue if (sentryIsEnabled && rec.error != null) { - var event = rec.toEvent(appVersion: appVersion); - sentryQueueControl.add(event); + _sendErrorToSentry(rec.error, null); } } @@ -254,33 +240,30 @@ class SuperLogging { } /// A queue to be consumed by [setupSentry]. - static final sentryQueueControl = StreamController(); + static final sentryQueueControl = StreamController(); /// Whether sentry logging is currently enabled or not. static bool sentryIsEnabled; static Future setupSentry() async { - sentryClient = SentryClient(dsn: config.sentryDsn); - await for (final event in sentryQueueControl.stream) { - dynamic error; + sentryClient = SentryClient(SentryOptions(dsn: config.sentryDsn)); + await for (final error in sentryQueueControl.stream) { try { - var response = await sentryClient.capture(event: event); - error = response.error; + sentryClient.captureException( + error, + ); } catch (e) { - error = e; + $.fine( + "sentry upload failed; will retry after ${config.sentryRetryDelay}", + ); + doSentryRetry(error); } - - if (error == null) continue; - $.fine( - "sentry upload failed; will retry after ${config.sentryRetryDelay} ($error)", - ); - doSentryRetry(event); } } - static void doSentryRetry(Event event) async { + static void doSentryRetry(Error error) async { await Future.delayed(config.sentryRetryDelay); - sentryQueueControl.add(event); + sentryQueueControl.add(error); } /// The log file currently in use. diff --git a/thirdparty/super_logging/pubspec.yaml b/thirdparty/super_logging/pubspec.yaml index f21183137..22052fb95 100644 --- a/thirdparty/super_logging/pubspec.yaml +++ b/thirdparty/super_logging/pubspec.yaml @@ -11,13 +11,13 @@ dependencies: flutter: sdk: flutter - package_info_plus: ^0.6.4 + package_info_plus: ^1.0.1 device_info: ^0.4.1+4 logging: ^0.11.4 - sentry: ^3.0.1 + sentry: ^5.0.0 intl: ^0.17.0 path: ^1.6.4 - path_provider: ^1.6.0 + path_provider: ^2.0.1 dev_dependencies: flutter_test: