From bd43b2ace84ee2b40ded31451e344956135c8c14 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Tue, 9 Jan 2024 11:45:41 -0300 Subject: [PATCH 01/18] feat(logging) - remove crashlytics - introduces Sentry and log errors on the logger class --- lib/main.dart | 33 ++++------- macos/Flutter/GeneratedPluginRegistrant.swift | 2 + packages/ardrive_logger/lib/src/logger.dart | 2 + packages/ardrive_logger/pubspec.yaml | 1 + pubspec.lock | 58 ++++++++++++------- pubspec.yaml | 1 + 6 files changed, 53 insertions(+), 44 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index f5077ac38f..080fc2b6f7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -29,8 +29,6 @@ import 'package:ardrive_io/ardrive_io.dart'; import 'package:ardrive_ui/ardrive_ui.dart'; import 'package:ardrive_utils/ardrive_utils.dart'; import 'package:arweave/arweave.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -42,9 +40,9 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; import 'package:pst/pst.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; import 'blocs/blocs.dart'; -import 'firebase_options.dart'; import 'models/models.dart'; import 'pages/pages.dart'; import 'services/services.dart'; @@ -57,8 +55,6 @@ late ArweaveService _arweave; late TurboUploadService _turboUpload; late PaymentService _turboPayment; void main() async { - WidgetsFlutterBinding.ensureInitialized(); - MobileStatusBar.show(); MobileScreenOrientation.lockInPortraitUp(); @@ -129,27 +125,18 @@ Future _initialize() async { } Future _runWithCrashlytics(String flavor) async { - runZonedGuarded>( - () async { - await Firebase.initializeApp( - options: DefaultFirebaseOptions.currentPlatform, - ); + await SentryFlutter.init( + (options) { + options.dsn = 'TODO: REPLACE WITH THE RIGHT DSN'; + // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. + // We recommend adjusting this value in production. + options.tracesSampleRate = 1.0; + }, + appRunner: () async { await _initialize(); - - FirebaseCrashlytics.instance - .log('Starting application with crashlytics for $flavor'); - - // Pass all uncaught errors from the framework to Crashlytics. - FlutterError.onError = - FirebaseCrashlytics.instance.recordFlutterFatalError; - + WidgetsFlutterBinding.ensureInitialized(); runApp(const App()); }, - (error, stack) => FirebaseCrashlytics.instance.recordError( - error, - stack, - fatal: true, - ), ); } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index ada08ba427..48d4b59404 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -17,6 +17,7 @@ import flutter_secure_storage_macos import just_audio import package_info_plus import path_provider_foundation +import sentry_flutter import share_plus import shared_preferences_foundation import sqflite @@ -37,6 +38,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) diff --git a/packages/ardrive_logger/lib/src/logger.dart b/packages/ardrive_logger/lib/src/logger.dart index 0850a30765..bafb568174 100644 --- a/packages/ardrive_logger/lib/src/logger.dart +++ b/packages/ardrive_logger/lib/src/logger.dart @@ -6,6 +6,7 @@ import 'dart:convert'; import 'package:ardrive_io/ardrive_io.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_email_sender/flutter_email_sender.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:share_plus/share_plus.dart'; Future _convertTextToIOFile({ @@ -75,6 +76,7 @@ class Logger { } log(LogLevel.error, errorMessage); + Sentry.captureException(error, stackTrace: stackTrace); } void log(LogLevel level, String message) { diff --git a/packages/ardrive_logger/pubspec.yaml b/packages/ardrive_logger/pubspec.yaml index 1168d3ae78..390302edb7 100644 --- a/packages/ardrive_logger/pubspec.yaml +++ b/packages/ardrive_logger/pubspec.yaml @@ -18,6 +18,7 @@ dependencies: share_plus: ^7.2.1 flutter_email_sender: ^6.0.2 mocktail: ^1.0.2 + sentry_flutter: ^7.14.0 dev_dependencies: diff --git a/pubspec.lock b/pubspec.lock index dc92dbaf38..5120dc6805 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -371,10 +371,10 @@ packages: dependency: "direct main" description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" confetti: dependency: "direct main" description: @@ -1383,10 +1383,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: "direct main" description: @@ -1591,10 +1591,10 @@ packages: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" plugin_platform_interface: dependency: transitive description: @@ -1706,6 +1706,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.1" + sentry: + dependency: transitive + description: + name: sentry + sha256: "89e426587b0879e53c46a0aae0eb312696d9d2d803ba14b252a65cc24b1416a2" + url: "https://pub.dev" + source: hosted + version: "7.14.0" + sentry_flutter: + dependency: "direct main" + description: + name: sentry_flutter + sha256: fd089ee4e75a927be037c56815a0a54af5a519f52b803a5ffecb589bb36e2401 + url: "https://pub.dev" + source: hosted + version: "7.14.0" share_plus: dependency: "direct main" description: @@ -1907,10 +1923,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" stash: dependency: "direct main" description: @@ -1939,10 +1955,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: @@ -2029,26 +2045,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" + sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f url: "https://pub.dev" source: hosted - version: "1.24.3" + version: "1.24.9" test_api: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" test_core: dependency: transitive description: name: test_core - sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" + sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a url: "https://pub.dev" source: hosted - version: "0.5.3" + version: "0.5.9" timeago: dependency: "direct main" description: @@ -2229,10 +2245,10 @@ packages: dependency: transitive description: name: vm_service - sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 url: "https://pub.dev" source: hosted - version: "11.7.1" + version: "11.10.0" watcher: dependency: transitive description: @@ -2245,10 +2261,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -2322,5 +2338,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.3 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.6" diff --git a/pubspec.yaml b/pubspec.yaml index a39199cd09..b7a323583a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -132,6 +132,7 @@ dependencies: loading_animation_widget: ^1.2.0+4 synchronized: ^3.1.0 confetti: ^0.7.0 + sentry_flutter: ^7.14.0 dependency_overrides: stripe_js: From 66f270730f8ba09e6f36f061f9e64256fd48e3fc Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 10:06:05 -0300 Subject: [PATCH 02/18] feat(logging) - initialize sentry with secrets --- .github/workflows/pr.yaml | 3 +- .github/workflows/production.yaml | 3 +- lib/main.dart | 53 +++++++++++++++++-------------- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1af8855f7a..22a534441e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,6 +12,7 @@ env: PR_NUMBER: ${{ github.event.pull_request.number }} PR_TITLE: ${{ github.event.pull_request.title }} RELEASE_NOTES: ${{ github.event.pull_request.title }} - ${{ github.sha }} + SENTRY_DSN: ${{secrets.SENTRY_DSN}} jobs: pre-build: @@ -42,7 +43,7 @@ jobs: run: | scr setup flutter config --enable-web - flutter build web --dart-define=environment=development --release --pwa-strategy=none --no-web-resources-cdn + flutter build web --dart-define=environment=development --dart-define=${SENTRY_DSN} --release --pwa-strategy=none --no-web-resources-cdn # JS files cache invalidation - name: main.dart.js and service worker cache invalidation diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index 708a02ec80..126bb7566d 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -14,6 +14,7 @@ on: env: BUILD_NUMBER: ${{ github.run_number }} RELEASE_NOTES: 'Production' + SENTRY_DSN: ${{secrets.SENTRY_DSN}} jobs: pre-build: @@ -44,7 +45,7 @@ jobs: run: | scr setup flutter config --enable-web - flutter build web --release --dart-define=environment=production --pwa-strategy=none --no-web-resources-cdn + flutter build web --release --dart-define=environment=production --dart-define=SENTRY_DSN=${SENTRY_DSN} --pwa-strategy=none --no-web-resources-cdn # Disribute to Firebase - uses: FirebaseExtended/action-hosting-deploy@v0 diff --git a/lib/main.dart b/lib/main.dart index 080fc2b6f7..5dbaa0796e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -55,32 +55,34 @@ late ArweaveService _arweave; late TurboUploadService _turboUpload; late PaymentService _turboPayment; void main() async { - MobileStatusBar.show(); - MobileScreenOrientation.lockInPortraitUp(); + await runZonedGuarded(() async { + WidgetsFlutterBinding.ensureInitialized(); + final localStore = await LocalKeyValueStore.getInstance(); - final localStore = await LocalKeyValueStore.getInstance(); + await AppInfoServices().loadAppInfo(); - await AppInfoServices().loadAppInfo(); + configService = ConfigService( + appFlavors: AppFlavors(EnvFetcher()), + configFetcher: ConfigFetcher(localStore: localStore), + ); - configService = ConfigService( - appFlavors: AppFlavors(EnvFetcher()), - configFetcher: ConfigFetcher(localStore: localStore), - ); + await configService.loadConfig(); - await configService.loadConfig(); + final flavor = await configService.loadAppFlavor(); - final flavor = await configService.loadAppFlavor(); + await _initialize(); - if (!kIsWeb) { if (flavor == Flavor.development) { - _runWithCrashlytics(flavor.name); + _runWithCrashlytics(); return; } - } - logger.d('Starting without crashlytics'); + logger.d('Starting without crashlytics'); - _runWithoutCrashlytics(); + _runWithoutCrashlytics(); + }, (error, stackTrace) async { + _runWithoutCrashlytics(); + }); } Future _runWithoutCrashlytics() async { @@ -89,6 +91,9 @@ Future _runWithoutCrashlytics() async { } Future _initialize() async { + MobileStatusBar.show(); + MobileScreenOrientation.lockInPortraitUp(); + SystemChrome.setSystemUIOverlayStyle( const SystemUiOverlayStyle(statusBarBrightness: Brightness.light), ); @@ -124,20 +129,20 @@ Future _initialize() async { } } -Future _runWithCrashlytics(String flavor) async { +Future _runWithCrashlytics() async { + const sentryDsn = String.fromEnvironment( + 'SENTRY_DSN', + defaultValue: '', + ); + await SentryFlutter.init( (options) { - options.dsn = 'TODO: REPLACE WITH THE RIGHT DSN'; - // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring. - // We recommend adjusting this value in production. + options.dsn = 'sentryDsn'; options.tracesSampleRate = 1.0; }, - appRunner: () async { - await _initialize(); - WidgetsFlutterBinding.ensureInitialized(); - runApp(const App()); - }, ); + + runApp(const App()); } void refreshHTMLPageAtInterval(Duration duration) { From 0fb5a9ca0841a36045c65f25fed1763bf8aaf63c Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 10:08:34 -0300 Subject: [PATCH 03/18] Update main.dart --- lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 2755a47a83..d2a56be45b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -137,7 +137,7 @@ Future _runWithCrashlytics() async { await SentryFlutter.init( (options) { - options.dsn = 'sentryDsn'; + options.dsn = sentryDsn; options.tracesSampleRate = 1.0; }, ); From 90db64753396a8df276ab632b7d5132454e1d946 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 10:20:51 -0300 Subject: [PATCH 04/18] Update pr.yaml --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 22a534441e..05b5c544d6 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -43,7 +43,7 @@ jobs: run: | scr setup flutter config --enable-web - flutter build web --dart-define=environment=development --dart-define=${SENTRY_DSN} --release --pwa-strategy=none --no-web-resources-cdn + flutter build web --dart-define=environment=development --dart-define=SENTRY_DSN=${SENTRY_DSN} --release --pwa-strategy=none --no-web-resources-cdn # JS files cache invalidation - name: main.dart.js and service worker cache invalidation From f8b842acbbaa9e42ed9ad19bb7690673184daece Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 11:13:47 -0300 Subject: [PATCH 05/18] feat(logging) set source maps upload on CI --- .github/workflows/pr.yaml | 8 ++++++-- lib/main.dart | 6 ------ pubspec.lock | 40 +++++++++++++++++++++++++++++++++++++++ pubspec.yaml | 10 ++++++++++ 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 05b5c544d6..9adc065a46 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -13,7 +13,10 @@ env: PR_TITLE: ${{ github.event.pull_request.title }} RELEASE_NOTES: ${{ github.event.pull_request.title }} - ${{ github.sha }} SENTRY_DSN: ${{secrets.SENTRY_DSN}} - + SENTRY_ORG: ${{secrets.SENTRY_ORG}} + SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}} + SENTRY_PROJECT: ${{secrets.SENTRY_PROJECT}} + jobs: pre-build: uses: ./.github/workflows/test.yml @@ -43,7 +46,8 @@ jobs: run: | scr setup flutter config --enable-web - flutter build web --dart-define=environment=development --dart-define=SENTRY_DSN=${SENTRY_DSN} --release --pwa-strategy=none --no-web-resources-cdn + flutter build web --dart-define=environment=development --dart-define=SENTRY_DSN=${SENTRY_DSN} --dart-define=SENTRY_PROJECT=${SENTRY_PROJECT} --dart-define=SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} --dart-define=SENTRY_ORG=${SENTRY_ORG} --release --pwa-strategy=none --no-web-resources-cdn + flutter packages pub run sentry_dart_plugin # JS files cache invalidation - name: main.dart.js and service worker cache invalidation diff --git a/lib/main.dart b/lib/main.dart index d2a56be45b..9191912117 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -130,14 +130,8 @@ Future _initialize() async { } Future _runWithCrashlytics() async { - const sentryDsn = String.fromEnvironment( - 'SENTRY_DSN', - defaultValue: '', - ); - await SentryFlutter.init( (options) { - options.dsn = sentryDsn; options.tracesSampleRate = 1.0; }, ); diff --git a/pubspec.lock b/pubspec.lock index 5120dc6805..dec6780601 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -41,6 +41,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.8" + ansicolor: + dependency: transitive + description: + name: ansicolor + sha256: "8bf17a8ff6ea17499e40a2d2542c2f481cd7615760c6d34065cb22bfd22e6880" + url: "https://pub.dev" + source: hosted + version: "2.0.2" app_settings: dependency: "direct main" description: @@ -998,6 +1006,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + globbing: + dependency: transitive + description: + name: globbing + sha256: "4f89cfaf6fa74c9c1740a96259da06bd45411ede56744e28017cc534a12b6e2d" + url: "https://pub.dev" + source: hosted + version: "1.0.0" gql: dependency: transitive description: @@ -1182,6 +1198,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.1+1" + injector: + dependency: transitive + description: + name: injector + sha256: ed389bed5b48a699d5b9561c985023d0d5cc88dd5ff2237aadcce5a5ab433e4e + url: "https://pub.dev" + source: hosted + version: "3.0.0" integration_test: dependency: "direct dev" description: flutter @@ -1714,6 +1738,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.14.0" + sentry_dart_plugin: + dependency: "direct dev" + description: + name: sentry_dart_plugin + sha256: fb46695c054b23ba631b16227c3e602ce31d1d5ccade9583d5184a7a74f7a2be + url: "https://pub.dev" + source: hosted + version: "1.6.3" sentry_flutter: dependency: "direct main" description: @@ -2025,6 +2057,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.0" + system_info2: + dependency: transitive + description: + name: system_info2 + sha256: "65206bbef475217008b5827374767550a5420ce70a04d2d7e94d1d2253f3efc9" + url: "https://pub.dev" + source: hosted + version: "4.0.0" system_info_plus: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index ccd28c456a..7f836ae21f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -176,6 +176,7 @@ dev_dependencies: drift_dev: mocktail: ^1.0.2 json_serializable: + sentry_dart_plugin: ^1.0.0 flutter: uses-material-design: true @@ -188,3 +189,12 @@ flutter: - assets/images/profile/ - assets/images/login/ - assets/animations/ + +sentry: + upload_debug_symbols: true + upload_source_maps: true + upload_sources: true + wait_for_processing: false + log_level: error + commits: none + ignore_missing: true \ No newline at end of file From a86d59c6f375b6e7941a9a4333e1fcde1ff7e6c0 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 11:30:51 -0300 Subject: [PATCH 06/18] Update pubspec.yaml --- pubspec.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7f836ae21f..e3017dc24a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -196,5 +196,4 @@ sentry: upload_sources: true wait_for_processing: false log_level: error - commits: none ignore_missing: true \ No newline at end of file From 9433a302b6353085b0ba6bea78a1766363210140 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 11:31:03 -0300 Subject: [PATCH 07/18] Update pr.yaml --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 9adc065a46..aea200667c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -22,7 +22,7 @@ jobs: uses: ./.github/workflows/test.yml build-web: - needs: pre-build + # needs: pre-build runs-on: ubuntu-latest steps: # Checkout From bc4e5f70e306ba487eba7f21f5887cf41f6bbc2a Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 11:41:50 -0300 Subject: [PATCH 08/18] Update pr.yaml --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index aea200667c..e5cfa853f3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -46,7 +46,7 @@ jobs: run: | scr setup flutter config --enable-web - flutter build web --dart-define=environment=development --dart-define=SENTRY_DSN=${SENTRY_DSN} --dart-define=SENTRY_PROJECT=${SENTRY_PROJECT} --dart-define=SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} --dart-define=SENTRY_ORG=${SENTRY_ORG} --release --pwa-strategy=none --no-web-resources-cdn + flutter build web --dart-define=environment=development --dart-define=SENTRY_DSN=${SENTRY_DSN} --dart-define=SENTRY_PROJECT=${SENTRY_PROJECT} --dart-define=SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} --dart-define=SENTRY_ORG=${SENTRY_ORG} --release --pwa-strategy=none --no-web-resources-cdn --source-maps flutter packages pub run sentry_dart_plugin # JS files cache invalidation From 49e9f13f635333f4848be300c917ce726a90d2a6 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Thu, 11 Jan 2024 12:15:41 -0300 Subject: [PATCH 09/18] Update logger.dart --- packages/ardrive_logger/lib/src/logger.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ardrive_logger/lib/src/logger.dart b/packages/ardrive_logger/lib/src/logger.dart index bafb568174..8184c4b530 100644 --- a/packages/ardrive_logger/lib/src/logger.dart +++ b/packages/ardrive_logger/lib/src/logger.dart @@ -76,7 +76,7 @@ class Logger { } log(LogLevel.error, errorMessage); - Sentry.captureException(error, stackTrace: stackTrace); + Sentry.captureException(message, stackTrace: stackTrace); } void log(LogLevel level, String message) { From ac2fd5d4b95c3e5545b0f09b377f7cb12c40a1a0 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Fri, 12 Jan 2024 08:41:49 -0300 Subject: [PATCH 10/18] feat(logging): use message when error is not provided --- lib/main.dart | 1 + packages/ardrive_logger/lib/src/logger.dart | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 9191912117..39dcd2fd40 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -57,6 +57,7 @@ late PaymentService _turboPayment; void main() async { await runZonedGuarded(() async { WidgetsFlutterBinding.ensureInitialized(); + final localStore = await LocalKeyValueStore.getInstance(); await AppInfoServices().loadAppInfo(); diff --git a/packages/ardrive_logger/lib/src/logger.dart b/packages/ardrive_logger/lib/src/logger.dart index 8184c4b530..f6854b013a 100644 --- a/packages/ardrive_logger/lib/src/logger.dart +++ b/packages/ardrive_logger/lib/src/logger.dart @@ -76,7 +76,7 @@ class Logger { } log(LogLevel.error, errorMessage); - Sentry.captureException(message, stackTrace: stackTrace); + Sentry.captureException(error ?? message, stackTrace: stackTrace); } void log(LogLevel level, String message) { From 9c16184bac0477526995ca4180ce8bd96e494299 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Fri, 12 Jan 2024 17:18:48 -0300 Subject: [PATCH 11/18] Update main.dart - refactor main file - enables Sentry only on staging and production --- lib/main.dart | 271 ++++++++++++++++++++++++++------------------------ 1 file changed, 141 insertions(+), 130 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 39dcd2fd40..0ed1a95296 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -39,6 +39,7 @@ import 'package:flutter_portal/flutter_portal.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; +import 'package:provider/single_child_widget.dart'; import 'package:pst/pst.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; @@ -54,57 +55,65 @@ late ConfigService configService; late ArweaveService _arweave; late TurboUploadService _turboUpload; late PaymentService _turboPayment; + void main() async { await runZonedGuarded(() async { WidgetsFlutterBinding.ensureInitialized(); - final localStore = await LocalKeyValueStore.getInstance(); + await _initializeServices(); - await AppInfoServices().loadAppInfo(); + await _startApp(); + }, (error, stackTrace) { + logger.e('Error caught.', error, stackTrace); + }); +} - configService = ConfigService( - appFlavors: AppFlavors(EnvFetcher()), - configFetcher: ConfigFetcher(localStore: localStore), - ); +Future _startApp() async { + final flavor = await configService.loadAppFlavor(); - await configService.loadConfig(); + flavor == Flavor.staging || flavor == Flavor.production + ? _runWithSentryLogging() + : _runWithoutLogging(); +} - final flavor = await configService.loadAppFlavor(); +Future _runWithoutLogging() async { + runApp(const App()); +} - await _initialize(); +Future _runWithSentryLogging() async { + await SentryFlutter.init( + (options) { + options.tracesSampleRate = 1.0; + }, + ); - if (flavor == Flavor.development) { - _runWithCrashlytics(); - return; - } + runApp(const App()); +} - logger.d('Starting without crashlytics'); +Future _initializeServices() async { + final localStore = await LocalKeyValueStore.getInstance(); - _runWithoutCrashlytics(); - }, (error, stackTrace) async { - _runWithoutCrashlytics(); - }); -} + await AppInfoServices().loadAppInfo(); -Future _runWithoutCrashlytics() async { - await _initialize(); - runApp(const App()); -} + configService = ConfigService( + appFlavors: AppFlavors(EnvFetcher()), + configFetcher: ConfigFetcher(localStore: localStore), + ); -Future _initialize() async { MobileStatusBar.show(); MobileScreenOrientation.lockInPortraitUp(); + ArDriveMobileDownloader.initialize(); SystemChrome.setSystemUIOverlayStyle( const SystemUiOverlayStyle(statusBarBrightness: Brightness.light), ); + await configService.loadConfig(); + final config = configService.config; logger.d('Initializing app with config: $config'); - ArDriveMobileDownloader.initialize(); - _arweave = ArweaveService( Arweave( gatewayUrl: Uri.parse(config.defaultArweaveGatewayUrl!), @@ -126,24 +135,10 @@ Future _initialize() async { ); if (kIsWeb) { - refreshHTMLPageAtInterval(const Duration(hours: 12)); + _refreshHTMLPageAtInterval(const Duration(hours: 12)); } } -Future _runWithCrashlytics() async { - await SentryFlutter.init( - (options) { - options.tracesSampleRate = 1.0; - }, - ); - - runApp(const App()); -} - -void refreshHTMLPageAtInterval(Duration duration) { - Timer.periodic(duration, (timer) => triggerHTMLPageReload()); -} - class App extends StatefulWidget { const App({Key? key}) : super(key: key); @@ -167,9 +162,108 @@ class AppState extends State { @override Widget build(BuildContext context) { return MultiRepositoryProvider( - providers: [ + providers: repositoryProviders, + child: ArDriveDevToolsShortcuts( + child: KeyboardHandler( + child: MultiBlocProvider( + providers: blocProviders, + child: BlocConsumer( + listener: (context, state) { + if (state is ThemeSwitcherDarkTheme) { + ArDriveUIThemeSwitcher.changeTheme(ArDriveThemes.dark); + } else if (state is ThemeSwitcherLightTheme) { + ArDriveUIThemeSwitcher.changeTheme(ArDriveThemes.light); + } + }, + builder: (context, state) { + return ArDriveApp( + onThemeChanged: (theme) { + context.read().add(ChangeTheme()); + }, + key: arDriveAppKey, + builder: (context) => app, + ); + }, + ), + ), + ), + ), + ); + } + + MaterialApp get app => MaterialApp.router( + title: _appName, + theme: _ardriveTheme, + debugShowCheckedModeBanner: false, + routeInformationParser: _routeInformationParser, + routerDelegate: _routerDelegate, + localizationsDelegates: _localizationsDelegates, + supportedLocales: _locales, + + // TODO: Remove this once we have a proper solution for + builder: (context, child) => ListTileTheme( + textColor: kOnSurfaceBodyTextColor, + iconColor: kOnSurfaceBodyTextColor, + child: Portal( + child: child!, + ), + ), + ); + + static const String _appName = 'ArDrive'; + + ThemeData get _ardriveTheme => + ArDriveTheme.of(context).themeData.materialThemeData.copyWith( + scaffoldBackgroundColor: + ArDriveTheme.of(context).themeData.backgroundColor, + ); + + Iterable get _locales => const [ + Locale('en', ''), // English, no country code + Locale('es', ''), // Spanish, no country code + Locale.fromSubtags(languageCode: 'zh'), // generic Chinese 'zh' + Locale.fromSubtags( + languageCode: 'zh', + countryCode: 'HK', + ), // Traditional Chinese, Cantonese + Locale('ja', ''), // Japanese, no country code + Locale('hi', ''), // Hindi, no country code + ]; + + Iterable get _localizationsDelegates => const [ + AppLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ]; + + List get blocProviders => [ ChangeNotifierProvider( create: (_) => ActivityTracker()), + BlocProvider( + create: (context) => ThemeSwitcherBloc( + userPreferencesRepository: + context.read(), + )..add(LoadTheme()), + ), + BlocProvider( + create: (context) => ProfileCubit( + arweave: context.read(), + turboUploadService: context.read(), + profileDao: context.read(), + db: context.read(), + tabVisibilitySingleton: TabVisibilitySingleton(), + ), + ), + BlocProvider( + create: (context) => ActivityCubit(), + ), + BlocProvider( + create: (context) => + FeedbackSurveyCubit(FeedbackSurveyInitialState()), + ), + ]; + + List get repositoryProviders => [ RepositoryProvider(create: (_) => _arweave), // repository provider for UploadFileChecker RepositoryProvider( @@ -242,92 +336,9 @@ class AppState extends State { themeDetector: ThemeDetector(), ), ), - ], - child: ArDriveDevToolsShortcuts( - child: KeyboardHandler( - child: MultiBlocProvider( - providers: [ - BlocProvider( - create: (context) => ThemeSwitcherBloc( - userPreferencesRepository: - context.read(), - )..add(LoadTheme()), - ), - BlocProvider( - create: (context) => ProfileCubit( - arweave: context.read(), - turboUploadService: context.read(), - profileDao: context.read(), - db: context.read(), - tabVisibilitySingleton: TabVisibilitySingleton(), - ), - ), - BlocProvider( - create: (context) => ActivityCubit(), - ), - BlocProvider( - create: (context) => - FeedbackSurveyCubit(FeedbackSurveyInitialState()), - ), - ], - child: BlocConsumer( - listener: (context, state) { - if (state is ThemeSwitcherDarkTheme) { - ArDriveUIThemeSwitcher.changeTheme(ArDriveThemes.dark); - } else if (state is ThemeSwitcherLightTheme) { - ArDriveUIThemeSwitcher.changeTheme(ArDriveThemes.light); - } - }, - builder: (context, state) { - return ArDriveApp( - onThemeChanged: (theme) { - context.read().add(ChangeTheme()); - }, - key: arDriveAppKey, - builder: (context) => MaterialApp.router( - title: 'ArDrive', - theme: ArDriveTheme.of(context) - .themeData - .materialThemeData - .copyWith( - scaffoldBackgroundColor: ArDriveTheme.of(context) - .themeData - .backgroundColor, - ), - debugShowCheckedModeBanner: false, - routeInformationParser: _routeInformationParser, - routerDelegate: _routerDelegate, - localizationsDelegates: const [ - AppLocalizations.delegate, - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - ], - supportedLocales: const [ - Locale('en', ''), // English, no country code - Locale('es', ''), // Spanish, no country code - Locale.fromSubtags( - languageCode: 'zh'), // generic Chinese 'zh' - Locale.fromSubtags( - languageCode: 'zh', - countryCode: 'HK', - ), // Traditional Chinese, Cantonese - Locale('ja', ''), // Japanese, no country code - Locale('hi', ''), // Hindi, no country code - ], - builder: (context, child) => ListTileTheme( - textColor: kOnSurfaceBodyTextColor, - iconColor: kOnSurfaceBodyTextColor, - child: Portal( - child: child!, - ), - ), - ), - ); - }, - ), - ), - ), - ), - ); - } + ]; +} + +void _refreshHTMLPageAtInterval(Duration duration) { + Timer.periodic(duration, (timer) => triggerHTMLPageReload()); } From ad8c623ac2fc3d4595a7a78461c156c0f53323ab Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Fri, 12 Jan 2024 17:34:05 -0300 Subject: [PATCH 12/18] chore: update workflows with sentry secrets --- .github/workflows/production.yaml | 3 ++- .github/workflows/staging.yaml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index 126bb7566d..887cb67a60 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -45,7 +45,8 @@ jobs: run: | scr setup flutter config --enable-web - flutter build web --release --dart-define=environment=production --dart-define=SENTRY_DSN=${SENTRY_DSN} --pwa-strategy=none --no-web-resources-cdn + flutter build web --release --dart-define=environment=production --dart-define=SENTRY_DSN=${SENTRY_DSN} --dart-define=SENTRY_PROJECT=${SENTRY_PROJECT} --dart-define=SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} --dart-define=SENTRY_ORG=${SENTRY_ORG} --pwa-strategy=none --no-web-resources-cdn + flutter packages pub run sentry_dart_plugin # Disribute to Firebase - uses: FirebaseExtended/action-hosting-deploy@v0 diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 3a6f67e1f8..a77f20a9b4 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -46,8 +46,9 @@ jobs: run: | scr setup flutter config --enable-web - flutter build web --dart-define=environment=staging --release --pwa-strategy=none --no-web-resources-cdn - + flutter build web --dart-define=environment=staging --dart-define=SENTRY_DSN=${SENTRY_DSN} --dart-define=SENTRY_PROJECT=${SENTRY_PROJECT} --dart-define=SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} --dart-define=SENTRY_ORG=${SENTRY_ORG} --release --pwa-strategy=none --no-web-resources-cdn + flutter packages pub run sentry_dart_plugin + # Deploy to github pages - uses: JamesIves/github-pages-deploy-action@4.1.1 with: From d9003e75f57065fba8f81265067572e372c6987f Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Fri, 12 Jan 2024 17:35:31 -0300 Subject: [PATCH 13/18] chore: add secrets --- .github/workflows/production.yaml | 4 ++++ .github/workflows/staging.yaml | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index 887cb67a60..55c2e64d6d 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -15,6 +15,10 @@ env: BUILD_NUMBER: ${{ github.run_number }} RELEASE_NOTES: 'Production' SENTRY_DSN: ${{secrets.SENTRY_DSN}} + SENTRY_ORG: ${{secrets.SENTRY_ORG}} + SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}} + SENTRY_PROJECT: ${{secrets.SENTRY_PROJECT}} + jobs: pre-build: diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index a77f20a9b4..cd1624986b 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -16,6 +16,10 @@ on: env: BUILD_NUMBER: ${{ github.run_number }} RELEASE_NOTES: Staging - ${{ github.sha }} + SENTRY_DSN: ${{secrets.SENTRY_DSN}} + SENTRY_ORG: ${{secrets.SENTRY_ORG}} + SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}} + SENTRY_PROJECT: ${{secrets.SENTRY_PROJECT}} jobs: pre-build: @@ -48,7 +52,7 @@ jobs: flutter config --enable-web flutter build web --dart-define=environment=staging --dart-define=SENTRY_DSN=${SENTRY_DSN} --dart-define=SENTRY_PROJECT=${SENTRY_PROJECT} --dart-define=SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} --dart-define=SENTRY_ORG=${SENTRY_ORG} --release --pwa-strategy=none --no-web-resources-cdn flutter packages pub run sentry_dart_plugin - + # Deploy to github pages - uses: JamesIves/github-pages-deploy-action@4.1.1 with: From 7dac408b588a7510c476bb0ec0afae0185d9f4c7 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Mon, 15 Jan 2024 11:34:43 -0300 Subject: [PATCH 14/18] Update pr.yaml --- .github/workflows/pr.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index e5cfa853f3..bf6a62d85c 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,17 +12,13 @@ env: PR_NUMBER: ${{ github.event.pull_request.number }} PR_TITLE: ${{ github.event.pull_request.title }} RELEASE_NOTES: ${{ github.event.pull_request.title }} - ${{ github.sha }} - SENTRY_DSN: ${{secrets.SENTRY_DSN}} - SENTRY_ORG: ${{secrets.SENTRY_ORG}} - SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}} - SENTRY_PROJECT: ${{secrets.SENTRY_PROJECT}} jobs: pre-build: uses: ./.github/workflows/test.yml build-web: - # needs: pre-build + needs: pre-build runs-on: ubuntu-latest steps: # Checkout @@ -46,7 +42,7 @@ jobs: run: | scr setup flutter config --enable-web - flutter build web --dart-define=environment=development --dart-define=SENTRY_DSN=${SENTRY_DSN} --dart-define=SENTRY_PROJECT=${SENTRY_PROJECT} --dart-define=SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} --dart-define=SENTRY_ORG=${SENTRY_ORG} --release --pwa-strategy=none --no-web-resources-cdn --source-maps + flutter build web --dart-define=environment=development --release --pwa-strategy=none --no-web-resources-cdn --source-maps flutter packages pub run sentry_dart_plugin # JS files cache invalidation From 5f25ec1f9d01dabe5cd13f3bc9ea93dab4fe27d8 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Mon, 15 Jan 2024 11:37:26 -0300 Subject: [PATCH 15/18] update pr workflow --- .github/workflows/pr.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index bf6a62d85c..2f4009c9d8 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -43,7 +43,6 @@ jobs: scr setup flutter config --enable-web flutter build web --dart-define=environment=development --release --pwa-strategy=none --no-web-resources-cdn --source-maps - flutter packages pub run sentry_dart_plugin # JS files cache invalidation - name: main.dart.js and service worker cache invalidation From 8b1cf2581b035d7bb09245681343d132d86240ba Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Fri, 19 Jan 2024 10:51:03 -0300 Subject: [PATCH 16/18] refactor(sentry) refactor sentry --- lib/main.dart | 8 +- .../ardrive_logger/lib/ardrive_logger.dart | 1 + packages/ardrive_logger/lib/src/sentry.dart | 28 +++ packages/pst/pubspec.lock | 218 +----------------- 4 files changed, 36 insertions(+), 219 deletions(-) create mode 100644 packages/ardrive_logger/lib/src/sentry.dart diff --git a/lib/main.dart b/lib/main.dart index 0ed1a95296..9fcea8c8fa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -26,6 +26,7 @@ import 'package:ardrive/utils/pre_cache_assets.dart'; import 'package:ardrive/utils/secure_key_value_store.dart'; import 'package:ardrive_http/ardrive_http.dart'; import 'package:ardrive_io/ardrive_io.dart'; +import 'package:ardrive_logger/ardrive_logger.dart'; import 'package:ardrive_ui/ardrive_ui.dart'; import 'package:ardrive_utils/ardrive_utils.dart'; import 'package:arweave/arweave.dart'; @@ -41,7 +42,6 @@ import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; import 'package:provider/single_child_widget.dart'; import 'package:pst/pst.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; import 'blocs/blocs.dart'; import 'models/models.dart'; @@ -81,11 +81,7 @@ Future _runWithoutLogging() async { } Future _runWithSentryLogging() async { - await SentryFlutter.init( - (options) { - options.tracesSampleRate = 1.0; - }, - ); + awaitinitSentry(); runApp(const App()); } diff --git a/packages/ardrive_logger/lib/ardrive_logger.dart b/packages/ardrive_logger/lib/ardrive_logger.dart index 83ab0d8b8f..677bed3f60 100644 --- a/packages/ardrive_logger/lib/ardrive_logger.dart +++ b/packages/ardrive_logger/lib/ardrive_logger.dart @@ -1,3 +1,4 @@ library ardrive_logger; export 'src/logger.dart'; +export 'src/sentry.dart'; diff --git a/packages/ardrive_logger/lib/src/sentry.dart b/packages/ardrive_logger/lib/src/sentry.dart new file mode 100644 index 0000000000..e45b48ea82 --- /dev/null +++ b/packages/ardrive_logger/lib/src/sentry.dart @@ -0,0 +1,28 @@ +import 'dart:async'; + +import 'package:sentry_flutter/sentry_flutter.dart'; + +FutureOr _beforeSend(SentryEvent event, {Hint? hint}) async { + event = event.copyWith( + user: SentryUser( + id: null, + username: null, + email: null, + ipAddress: null, + geo: null, + name: null, + data: null, + ), + ); + + return event; +} + +Future initSentry() async { + await SentryFlutter.init( + (options) { + options.beforeSend = _beforeSend; + options.tracesSampleRate = 1.0; + }, + ); +} diff --git a/packages/pst/pubspec.lock b/packages/pst/pubspec.lock index d6f6d59ddf..3280096c79 100644 --- a/packages/pst/pubspec.lock +++ b/packages/pst/pubspec.lock @@ -1,22 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a - url: "https://pub.dev" - source: hosted - version: "61.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 - url: "https://pub.dev" - source: hosted - version: "5.13.0" ardrive_http: dependency: "direct main" description: @@ -33,23 +17,15 @@ packages: relative: true source: path version: "0.0.1" - args: - dependency: transitive - description: - name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 - url: "https://pub.dev" - source: hosted - version: "2.4.2" arweave: dependency: "direct main" description: path: "." - ref: "v3.8.2" - resolved-ref: "363d4b69be03d2e67390e7c70eb7c3a230377001" + ref: "v3.8.3" + resolved-ref: "41d590687cecafc316b3c83da20274a29d3e2833" url: "https://github.com/ardriveapp/arweave-dart.git" source: git - version: "3.8.2" + version: "3.8.3" async: dependency: transitive description: @@ -146,14 +122,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.1" - coverage: - dependency: transitive - description: - name: coverage - sha256: "595a29b55ce82d53398e1bcc2cba525d7bd7c59faeb2d2540e9d42c390cfeeeb" - url: "https://pub.dev" - source: hosted - version: "1.6.4" crypto: dependency: transitive description: @@ -298,22 +266,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.dev" - source: hosted - version: "3.2.0" - glob: - dependency: transitive - description: - name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" - source: hosted - version: "2.1.2" hash: dependency: transitive description: @@ -354,14 +306,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" - source: hosted - version: "3.2.1" http_parser: dependency: transitive description: @@ -370,14 +314,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - io: - dependency: transitive - description: - name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" - source: hosted - version: "1.0.4" isolated_worker: dependency: transitive description: @@ -418,14 +354,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" - logging: - dependency: transitive - description: - name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" - source: hosted - version: "1.2.0" matcher: dependency: transitive description: @@ -450,22 +378,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" - mime: - dependency: transitive - description: - name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" - source: hosted - version: "1.0.4" mocktail: dependency: "direct main" description: name: mocktail - sha256: "80a996cd9a69284b3dc521ce185ffe9150cde69767c2d3a0720147d93c0cef53" + sha256: c4b5007d91ca4f67256e720cb1b6d704e79a510183a12fa551021f652577dce6 url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "1.0.3" mutex: dependency: transitive description: @@ -474,22 +394,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.0" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - package_config: - dependency: transitive - description: - name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" - source: hosted - version: "2.1.0" package_info_plus: dependency: transitive description: @@ -538,22 +442,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.7.3" - pool: - dependency: transitive - description: - name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" - source: hosted - version: "1.5.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.dev" - source: hosted - version: "2.1.4" retry: dependency: "direct main" description: @@ -570,14 +458,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.1" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" - url: "https://pub.dev" - source: hosted - version: "3.0.2" shelf_router: dependency: transitive description: @@ -586,43 +466,11 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.4" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e - url: "https://pub.dev" - source: hosted - version: "1.1.2" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" - url: "https://pub.dev" - source: hosted - version: "1.0.4" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" - url: "https://pub.dev" - source: hosted - version: "0.10.12" source_span: dependency: transitive description: @@ -663,14 +511,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" - test: - dependency: transitive - description: - name: test - sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f - url: "https://pub.dev" - source: hosted - version: "1.24.9" test_api: dependency: transitive description: @@ -679,14 +519,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.1" - test_core: - dependency: transitive - description: - name: test_core - sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a - url: "https://pub.dev" - source: hosted - version: "0.5.9" typed_data: dependency: transitive description: @@ -719,22 +551,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 - url: "https://pub.dev" - source: hosted - version: "11.10.0" - watcher: - dependency: transitive - description: - name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.dev" - source: hosted - version: "1.1.0" web: dependency: transitive description: @@ -743,22 +559,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.0" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b - url: "https://pub.dev" - source: hosted - version: "2.4.0" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" - url: "https://pub.dev" - source: hosted - version: "1.2.1" win32: dependency: transitive description: @@ -775,14 +575,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" - yaml: - dependency: transitive - description: - name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" - source: hosted - version: "3.1.2" sdks: dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.7.12" From c167e5f43f196cd38475b40c1a4a8b3cb46e4c3a Mon Sep 17 00:00:00 2001 From: Karl Prieb Date: Fri, 19 Jan 2024 11:17:00 -0300 Subject: [PATCH 17/18] Update lib/main.dart --- lib/main.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 9fcea8c8fa..ffaf7001a8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -26,7 +26,6 @@ import 'package:ardrive/utils/pre_cache_assets.dart'; import 'package:ardrive/utils/secure_key_value_store.dart'; import 'package:ardrive_http/ardrive_http.dart'; import 'package:ardrive_io/ardrive_io.dart'; -import 'package:ardrive_logger/ardrive_logger.dart'; import 'package:ardrive_ui/ardrive_ui.dart'; import 'package:ardrive_utils/ardrive_utils.dart'; import 'package:arweave/arweave.dart'; From 3873da079769d833496d5428ab9d4d5ddbe8e8ce Mon Sep 17 00:00:00 2001 From: Thiago Carvalho Date: Fri, 19 Jan 2024 11:21:59 -0300 Subject: [PATCH 18/18] Update main.dart --- lib/main.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index ffaf7001a8..e0bd246033 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -26,6 +26,7 @@ import 'package:ardrive/utils/pre_cache_assets.dart'; import 'package:ardrive/utils/secure_key_value_store.dart'; import 'package:ardrive_http/ardrive_http.dart'; import 'package:ardrive_io/ardrive_io.dart'; +import 'package:ardrive_logger/ardrive_logger.dart'; import 'package:ardrive_ui/ardrive_ui.dart'; import 'package:ardrive_utils/ardrive_utils.dart'; import 'package:arweave/arweave.dart'; @@ -80,7 +81,7 @@ Future _runWithoutLogging() async { } Future _runWithSentryLogging() async { - awaitinitSentry(); + await initSentry(); runApp(const App()); }