Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-5865: Release ArDrive App v2.39.0 #1680

Merged
merged 25 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c7ad2bb
refactor(sync):
thiagocarvalhodev Feb 29, 2024
74e1a79
wip
thiagocarvalhodev Feb 29, 2024
1dec226
feat(sync)
thiagocarvalhodev Mar 4, 2024
9c435b7
Update sync_cubit.dart
thiagocarvalhodev Mar 4, 2024
7bb16d8
refactor(sync cubit)
thiagocarvalhodev Mar 4, 2024
75ea76f
chore: fix lint warnings
thiagocarvalhodev Mar 4, 2024
167bf5b
refactor(sync cubit)
thiagocarvalhodev Mar 8, 2024
f85be55
feat(sync)
thiagocarvalhodev Mar 8, 2024
f90e3fa
refactor(sync)
thiagocarvalhodev Mar 13, 2024
f085ba3
refactor(sync)
thiagocarvalhodev Mar 13, 2024
2e03af8
Merge branch 'dev' into PE-5423
karlprieb Mar 14, 2024
3340e0c
fix tests and minor changes
thiagocarvalhodev Mar 14, 2024
d822da7
Update sync_repository.dart
thiagocarvalhodev Mar 18, 2024
f239caa
Update create_snapshot_cubit.dart
thiagocarvalhodev Mar 20, 2024
cb1a200
Update get_segmented_transaction_from_drive_strategy.dart
thiagocarvalhodev Mar 20, 2024
4d2102f
Merge pull request #1671 from ardriveapp/PE-5843-persistant-snapshot-…
thiagocarvalhodev Mar 21, 2024
785d013
add the batch
thiagocarvalhodev Mar 22, 2024
815c782
Merge pull request #1673 from ardriveapp/PE-5843-with-batching-strategy
karlprieb Mar 25, 2024
dd33486
Update snapshot_item_to_be_created.dart
thiagocarvalhodev Mar 27, 2024
d24f955
Merge pull request #1676 from ardriveapp/PE-5843-with-batching-strategy
thiagocarvalhodev Mar 27, 2024
e688e00
Merge pull request #1665 from ardriveapp/PE-5423
thiagocarvalhodev Mar 27, 2024
cb01927
release notes
thiagocarvalhodev Mar 28, 2024
fa39458
Update 117.txt
thiagocarvalhodev Mar 28, 2024
336395b
Update 117.txt
thiagocarvalhodev Mar 28, 2024
54cd64d
Merge pull request #1679 from ardriveapp/PE-5865-release-ar-drive-app…
thiagocarvalhodev Mar 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions android/fastlane/metadata/android/en-US/changelogs/117.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Optimizes sync load time
- Fixes an issue when creating large snapshots on Firefox
2 changes: 2 additions & 0 deletions lib/app_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:ardrive/components/profile_card.dart';
import 'package:ardrive/components/side_bar.dart';
import 'package:ardrive/gift/reedem_button.dart';
import 'package:ardrive/pages/drive_detail/components/hover_widget.dart';
import 'package:ardrive/sync/domain/cubit/sync_cubit.dart';
import 'package:ardrive/sync/domain/sync_progress.dart';
import 'package:ardrive/utils/logger.dart';
import 'package:ardrive/utils/size_constants.dart';
import 'package:ardrive_ui/ardrive_ui.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/blocs/blocs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ export 'keyboard_listener/keyboard_listener_bloc.dart';
export 'profile/profile_cubit.dart';
export 'profile_add/profile_add_cubit.dart';
export 'shared_file/shared_file_cubit.dart';
export 'sync/sync_cubit.dart';
export 'upload/upload_cubit.dart';
79 changes: 39 additions & 40 deletions lib/blocs/create_snapshot/create_snapshot_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,39 +110,58 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
await _reset(driveId);
} catch (e) {
emit(ComputeSnapshotDataFailure(errorMessage: e.toString()));
logger.e('Error while resetting snapshot creation parameters', e);
return;
}

final profileState = _profileCubit.state as ProfileLoggedIn;
_ownerAddress = profileState.walletAddress;

_setTrustedRange(range);

late Uint8List data;
try {
final profileState = _profileCubit.state as ProfileLoggedIn;
_ownerAddress = profileState.walletAddress;

_setTrustedRange(range);

data = await _getSnapshotData();

if (_wasCancelled()) return;

_setupSnapshotEntityWithBlob(data);

logger.d('Computed snapshot data size: ${data.length} bytes');
logger.d('Computing cost and balance estimate');

await _computeCost();
await _computeBalanceEstimate();
_computeIsSufficientBalance();
_computeIsTurboEnabled();
_computeIsFreeThanksToTurbo();
_computeIsButtonEnabled();

logger.d('Computed cost and balance estimate');

emit(
ConfirmingSnapshotCreation(
snapshotSize: data.length,
costEstimateAr: _costEstimateAr,
costEstimateTurbo: _costEstimateTurbo,
hasNoTurboBalance: _hasNoTurboBalance,
isTurboUploadPossible: _isTurboUploadPossible,
arBalance: _arBalance,
turboCredits: _turboCredits,
uploadMethod: _uploadMethod,
isButtonToUploadEnabled: _isButtonToUploadEnabled,
sufficientBalanceToPayWithAr: _sufficientArBalance,
sufficientBalanceToPayWithTurbo: _sufficentCreditsBalance,
isFreeThanksToTurbo: _isFreeThanksToTurbo,
),
);
} catch (e) {
if (_wasCancelled()) return;

// If it was not cancelled, then there was a failure.
emit(ComputeSnapshotDataFailure(errorMessage: e.toString()));
return;
logger.e('Error while getting snapshot data', e);
}

_setupSnapshotEntityWithBlob(data);

await _computeCost();
await _computeBalanceEstimate();
_computeIsSufficientBalance();
_computeIsTurboEnabled();
_computeIsFreeThanksToTurbo();
_computeIsButtonEnabled();

await _emitConfirming(
dataSize: data.length,
);
}

bool _wasCancelled() {
Expand Down Expand Up @@ -196,16 +215,13 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
// transforms the stream of arrays into a flat stream
final flatGQLEdgesStream = gqlEdgesStream.expand((element) => element);

// maps the items to GQL Nodes
final gqlNodesStream = flatGQLEdgesStream.map((edge) => edge.node);

// declares the reading stream from the SnapshotItemToBeCreated
final snapshotItemToBeCreated = SnapshotItemToBeCreated(
blockStart: _range.start,
blockEnd: _range.end,
driveId: _driveId,
subRanges: HeightRange(rangeSegments: [_range]),
source: gqlNodesStream,
source: flatGQLEdgesStream,
jsonMetadataOfTxId: _jsonMetadataOfTxId,
);

Expand Down Expand Up @@ -496,23 +512,6 @@ class CreateSnapshotCubit extends Cubit<CreateSnapshotState> {
_isFreeThanksToTurbo = isFreeThanksToTurbo && !forceNoFreeThanksToTurbo;
}

Future<void> _emitConfirming({required int dataSize}) async {
emit(ConfirmingSnapshotCreation(
snapshotSize: dataSize,
costEstimateAr: _costEstimateAr,
costEstimateTurbo: _costEstimateTurbo,
hasNoTurboBalance: _hasNoTurboBalance,
isTurboUploadPossible: _isTurboUploadPossible,
arBalance: _arBalance,
turboCredits: _turboCredits,
uploadMethod: _uploadMethod,
isButtonToUploadEnabled: _isButtonToUploadEnabled,
sufficientBalanceToPayWithAr: _sufficientArBalance,
sufficientBalanceToPayWithTurbo: _sufficentCreditsBalance,
isFreeThanksToTurbo: _isFreeThanksToTurbo,
));
}

void setUploadMethod(UploadMethod method) {
logger.d('Upload method set to $method');
_uploadMethod = method;
Expand Down
1 change: 1 addition & 0 deletions lib/blocs/drive_attach/drive_attach_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:ardrive/blocs/blocs.dart';
import 'package:ardrive/core/arfs/entities/arfs_entities.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/sync/domain/cubit/sync_cubit.dart';
import 'package:ardrive/utils/logger.dart';
import 'package:ardrive/utils/plausible_event_tracker/plausible_event_tracker.dart';
import 'package:ardrive_utils/ardrive_utils.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/blocs/drive_rename/drive_rename_cubit.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:ardrive/blocs/blocs.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/sync/domain/cubit/sync_cubit.dart';
import 'package:ardrive/turbo/services/upload_service.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/blocs/file_download/file_download_cubit.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:async';

import 'package:ardrive/blocs/blocs.dart';
import 'package:ardrive/core/arfs/entities/arfs_entities.dart';
import 'package:ardrive/core/arfs/repository/arfs_repository.dart';
import 'package:ardrive/core/crypto/crypto.dart';
Expand All @@ -9,6 +8,7 @@ import 'package:ardrive/download/limits.dart';
import 'package:ardrive/entities/constants.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/sync/domain/sync_progress.dart';
import 'package:ardrive/utils/logger.dart';
import 'package:ardrive_io/ardrive_io.dart' as io;
import 'package:ardrive_io/ardrive_io.dart';
Expand Down
1 change: 1 addition & 0 deletions 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/sync/domain/cubit/sync_cubit.dart';
import 'package:ardrive/turbo/services/upload_service.dart';
import 'package:ardrive/utils/logger.dart';
import 'package:arweave/arweave.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/blocs/fs_entry_rename/fs_entry_rename_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/core/crypto/crypto.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/sync/domain/cubit/sync_cubit.dart';
import 'package:ardrive/turbo/services/upload_service.dart';
import 'package:ardrive/utils/logger.dart';
import 'package:ardrive_io/ardrive_io.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/blocs/ghost_fixer/ghost_fixer_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:ardrive/blocs/blocs.dart';
import 'package:ardrive/models/models.dart';
import 'package:ardrive/pages/pages.dart';
import 'package:ardrive/services/services.dart';
import 'package:ardrive/sync/domain/cubit/sync_cubit.dart';
import 'package:ardrive/turbo/services/upload_service.dart';
import 'package:ardrive/utils/logger.dart';
import 'package:equatable/equatable.dart';
Expand Down
68 changes: 0 additions & 68 deletions lib/blocs/sync/utils/add_drive_entity_revisions.dart

This file was deleted.

101 changes: 0 additions & 101 deletions lib/blocs/sync/utils/add_file_entity_revisions.dart

This file was deleted.

Loading
Loading