Skip to content

Commit

Permalink
Merge pull request #1183 from ardriveapp/dev
Browse files Browse the repository at this point in the history
PE-4321: Release v2.4.1
  • Loading branch information
thiagocarvalhodev authored Jul 3, 2023
2 parents 03753d0 + 2a426fe commit a2078b3
Show file tree
Hide file tree
Showing 70 changed files with 1,120 additions and 941 deletions.
2 changes: 2 additions & 0 deletions android/fastlane/metadata/android/en-US/changelogs/49.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Update Zendesk/Help link
- Optimized the TransactionStatuses GQL query to only run for items not captured by snapshots, reducing unnecessary network requests and improving performance.
4 changes: 2 additions & 2 deletions assets/config/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"defaultArweaveGatewayUrl": "https://arweave.net",
"useTurboUpload": true,
"useTurboPayment": true,
"defaultTurboUploadUrl": "https://upload.ardrive.dev",
"defaultTurboPaymentUrl": "https://payment.ardrive.dev",
"defaultTurboUploadUrl": "https://upload.ardrive.io",
"defaultTurboPaymentUrl": "https://payment.ardrive.io",
"allowedDataItemSizeForTurbo": 500000,
"enableQuickSyncAuthoring": true,
"enableMultipleFileDownload": true,
Expand Down
6 changes: 3 additions & 3 deletions lib/app_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ class AppShellState extends State<AppShell> {
: scaffold,
),
);
return ScreenTypeLayout(
desktop: buildPage(
return ScreenTypeLayout.builder(
desktop: (context) => buildPage(
Row(
children: [
const AppSideBar(),
Expand All @@ -142,7 +142,7 @@ class AppShellState extends State<AppShell> {
],
),
),
mobile: buildPage(widget.page),
mobile: (context) => buildPage(widget.page),
);
},
);
Expand Down
2 changes: 1 addition & 1 deletion lib/authentication/login/blocs/login_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {

return wallet;
} catch (e) {
debugPrint('Invalid wallet file: $e');
logger.d('Invalid wallet file: $e');

return null;
}
Expand Down
26 changes: 13 additions & 13 deletions lib/authentication/login/views/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class _LoginPageScaffoldState extends State<LoginPageScaffold> {

@override
Widget build(BuildContext context) {
return ScreenTypeLayout(
desktop: Material(
return ScreenTypeLayout.builder(
desktop: (context) => Material(
color: ArDriveTheme.of(context).themeData.backgroundColor,
child: Row(
children: [
Expand All @@ -95,7 +95,7 @@ class _LoginPageScaffoldState extends State<LoginPageScaffold> {
],
),
),
mobile: Scaffold(
mobile: (context) => Scaffold(
resizeToAvoidBottomInset: true,
body: SingleChildScrollView(
child: Padding(
Expand Down Expand Up @@ -315,9 +315,9 @@ class _PromptWalletViewState extends State<PromptWalletView> {
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ScreenTypeLayout(
desktop: const SizedBox.shrink(),
mobile: ArDriveImage(
ScreenTypeLayout.builder(
desktop: (context) => const SizedBox.shrink(),
mobile: (context) => ArDriveImage(
image: AssetImage(Resources.images.brand.logo1),
height: 50,
),
Expand Down Expand Up @@ -515,7 +515,7 @@ class _LoginCard extends StatelessWidget {
final deviceType = getDeviceType(MediaQuery.of(context).size);

switch (deviceType) {
case DeviceScreenType.desktop:
case DeviceScreenType.desktop:
if (constraints.maxWidth >= 512) {
horizontalPadding = 72;
} else {
Expand Down Expand Up @@ -715,9 +715,9 @@ class _CreatePasswordViewState extends State<CreatePasswordView> {
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ScreenTypeLayout(
desktop: const SizedBox.shrink(),
mobile: ArDriveImage(
ScreenTypeLayout.builder(
desktop: (context) => const SizedBox.shrink(),
mobile: (context) => ArDriveImage(
image: AssetImage(Resources.images.brand.logo1),
height: 50,
),
Expand Down Expand Up @@ -996,8 +996,8 @@ class OnBoardingViewState extends State<OnBoardingView> {

@override
Widget build(BuildContext context) {
return ScreenTypeLayout(
desktop: Material(
return ScreenTypeLayout.builder(
desktop: (context) => Material(
color: ArDriveTheme.of(context).themeData.colors.themeBgCanvas,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down Expand Up @@ -1027,7 +1027,7 @@ class OnBoardingViewState extends State<OnBoardingView> {
],
),
),
mobile: Scaffold(
mobile: (context) => Scaffold(
resizeToAvoidBottomInset: true,
body: Container(
color: ArDriveTheme.of(context).themeData.colors.themeBgCanvas,
Expand Down
3 changes: 2 additions & 1 deletion lib/blocs/create_manifest/create_manifest_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:ardrive/entities/string_types.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/utils/ar_cost_to_usd.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:arweave/arweave.dart';
import 'package:arweave/utils.dart';
import 'package:collection/collection.dart';
Expand Down Expand Up @@ -336,7 +337,7 @@ class CreateManifestCubit extends Cubit<CreateManifestState> {
emit(CreateManifestFailure());
super.onError(error, stackTrace);

print('Failed to create manifest: $error $stackTrace');
logger.i('Failed to create manifest: $error $stackTrace');
}
}

Expand Down
27 changes: 14 additions & 13 deletions lib/blocs/create_snapshot/create_snapshot_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:ardrive/services/arweave/arweave.dart';
import 'package:ardrive/services/pst/pst.dart';
import 'package:ardrive/utils/ar_cost_to_usd.dart';
import 'package:ardrive/utils/html/html_util.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:ardrive/utils/metadata_cache.dart';
import 'package:ardrive/utils/snapshots/height_range.dart';
import 'package:ardrive/utils/snapshots/range.dart';
Expand Down Expand Up @@ -139,7 +140,7 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
}

// ignore: avoid_print
print(
logger.i(
'Trusted range to be snapshotted (Current height: $_currentHeight): $_range',
);
}
Expand Down Expand Up @@ -183,7 +184,7 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
Uint8List data,
) async {
// ignore: avoid_print
print('About to prepare and sign snapshot transaction');
logger.i('About to prepare and sign snapshot transaction');

final isArConnectProfile = await _profileCubit.isCurrentProfileArConnect();

Expand All @@ -205,7 +206,7 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {

try {
// ignore: avoid_print
print(
logger.i(
'Preparing snapshot transaction with ${isArConnectProfile ? 'ArConnect' : 'JSON wallet'}',
);

Expand All @@ -220,15 +221,15 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
final isTabFocused = _tabVisibility.isTabFocused();
if (isArConnectProfile && !isTabFocused) {
// ignore: avoid_print
print(
logger.i(
'Preparing snapshot transaction while user is not focusing the tab. Waiting...',
);
await _tabVisibility.onTabGetsFocusedFuture(
() async => await prepareTx(isArConnectProfile),
);
} else {
// ignore: avoid_print
print(
logger.i(
'Error preparing snapshot transaction - $e isArConnectProfile: $isArConnectProfile, isTabFocused: $isTabFocused');
rethrow;
}
Expand All @@ -242,7 +243,7 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {

try {
// ignore: avoid_print
print(
logger.i(
'Signing snapshot transaction with ${isArConnectProfile ? 'ArConnect' : 'JSON wallet'}',
);

Expand All @@ -257,7 +258,7 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
final isTabFocused = _tabVisibility.isTabFocused();
if (isArConnectProfile && !isTabFocused) {
// ignore: avoid_print
print(
logger.i(
'Signing snapshot transaction while user is not focusing the tab. Waiting...',
);
await _tabVisibility.onTabGetsFocusedFuture(
Expand All @@ -267,7 +268,7 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
);
} else {
// ignore: avoid_print
print(
logger.i(
'Error signing snapshot transaction - $e isArConnectProfile: $isArConnectProfile, isTabFocused: $isTabFocused');
rethrow;
}
Expand All @@ -276,7 +277,7 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {

Future<Uint8List> _getSnapshotData() async {
// ignore: avoid_print
print('Computing snapshot data');
logger.i('Computing snapshot data');

emit(ComputingSnapshotData(
driveId: _driveId,
Expand Down Expand Up @@ -304,7 +305,7 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
}

// ignore: avoid_print
print('Finished computing snapshot data');
logger.i('Finished computing snapshot data');

final data = dataBuffer.takeBytes();
return data;
Expand Down Expand Up @@ -399,7 +400,7 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
Future<void> confirmSnapshotCreation() async {
if (await _profileCubit.logoutIfWalletMismatch()) {
// ignore: avoid_print
print('Failed to confirm the upload: Wallet mismatch');
logger.i('Failed to confirm the upload: Wallet mismatch');
emit(SnapshotUploadFailure(errorMessage: 'Wallet mismatch.'));
return;
}
Expand All @@ -412,15 +413,15 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
emit(SnapshotUploadSuccess());
} catch (err) {
// ignore: avoid_print
print(
logger.i(
'Error while posting the snapshot transaction: ${(err as TypeError).stackTrace}');
emit(SnapshotUploadFailure(errorMessage: '$err'));
}
}

void cancelSnapshotCreation() {
// ignore: avoid_print
print('User cancelled the snapshot creation');
logger.i('User cancelled the snapshot creation');

_wasSnapshotDataComputingCanceled = true;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/blocs/drive_attach/drive_attach_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:ardrive/entities/entities.dart';
import 'package:ardrive/entities/string_types.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:arweave/utils.dart';
import 'package:cryptography/cryptography.dart';
import 'package:equatable/equatable.dart';
Expand Down Expand Up @@ -235,6 +236,6 @@ class DriveAttachCubit extends Cubit<DriveAttachState> {
emit(DriveAttachFailure());
super.onError(error, stackTrace);

print('Failed to attach drive: $error $stackTrace');
logger.i('Failed to attach drive: $error $stackTrace');
}
}
3 changes: 2 additions & 1 deletion lib/blocs/drive_create/drive_create_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:ardrive/blocs/blocs.dart';
import 'package:ardrive/entities/entities.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:arweave/arweave.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
Expand Down Expand Up @@ -143,6 +144,6 @@ class DriveCreateCubit extends Cubit<DriveCreateState> {
emit(DriveCreateFailure());
super.onError(error, stackTrace);

print('Failed to create drive: $error $stackTrace');
logger.e('Failed to create drive: $error $stackTrace');
}
}
1 change: 1 addition & 0 deletions lib/blocs/file_download/file_download_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:ardrive/models/models.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/utils/app_platform.dart';
import 'package:ardrive/utils/data_size.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:ardrive_http/ardrive_http.dart';
import 'package:ardrive_io/ardrive_io.dart';
import 'package:cryptography/cryptography.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/file_download/personal_file_download_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class ProfileFileDownloadCubit extends FileDownloadCubit {

@visibleForTesting
bool isSizeAbovePrivateLimit(int size) {
debugPrint(_privateFileLimit.toString());
logger.d(_privateFileLimit.toString());
return size > _privateFileLimit;
}

Expand Down Expand Up @@ -192,6 +192,6 @@ class ProfileFileDownloadCubit extends FileDownloadCubit {
);
super.onError(error, stackTrace);

debugPrint('Failed to download personal file: $error $stackTrace');
logger.e('Failed to download personal file: $error $stackTrace');
}
}
3 changes: 2 additions & 1 deletion lib/blocs/folder_create/folder_create_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:ardrive/blocs/blocs.dart';
import 'package:ardrive/entities/entities.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down Expand Up @@ -120,6 +121,6 @@ class FolderCreateCubit extends Cubit<FolderCreateState> {
emit(FolderCreateFailure());
super.onError(error, stackTrace);

print('Failed to create folder: $error $stackTrace');
logger.e('Failed to create folder: $error $stackTrace');
}
}
3 changes: 2 additions & 1 deletion lib/blocs/fs_entry_activity/fs_entry_activity_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';

import 'package:ardrive/models/models.dart';
import 'package:ardrive/pages/pages.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down Expand Up @@ -67,7 +68,7 @@ class FsEntryActivityCubit extends Cubit<FsEntryActivityState> {
emit(FsEntryActivityFailure());
super.onError(error, stackTrace);

print('Failed to load entity activity: $error $stackTrace');
logger.e('Failed to load entity activity: $error $stackTrace');
}

@override
Expand Down
3 changes: 2 additions & 1 deletion lib/blocs/fs_entry_info/fs_entry_info_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';

import 'package:ardrive/models/models.dart';
import 'package:ardrive/pages/pages.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Expand Down Expand Up @@ -91,7 +92,7 @@ class FsEntryInfoCubit extends Cubit<FsEntryInfoState> {
emit(FsEntryInfoFailure());
super.onError(error, stackTrace);

print('Failed to load entity info: $error $stackTrace');
logger.e('Failed to load entity info: $error $stackTrace');
}

@override
Expand Down
3 changes: 2 additions & 1 deletion lib/blocs/fs_entry_move/fs_entry_move_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:ardrive/core/crypto/crypto.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/pages/drive_detail/drive_detail_page.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/utils/logger/logger.dart';
import 'package:arweave/arweave.dart';
import 'package:bloc_concurrency/bloc_concurrency.dart';
import 'package:equatable/equatable.dart';
Expand Down Expand Up @@ -77,7 +78,7 @@ class FsEntryMoveBloc extends Bloc<FsEntryMoveEvent, FsEntryMoveState> {
parentFolder: folderInView,
);
} catch (err) {
print('Error moving items: $err');
logger.e('Error moving items: $err');
}
emit(const FsEntryMoveSuccess());
} else {
Expand Down
Loading

0 comments on commit a2078b3

Please sign in to comment.