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-3699: uploads large files for public drives #1383

Merged
merged 65 commits into from
Oct 6, 2023

Conversation

thiagocarvalhodev
Copy link
Collaborator

@thiagocarvalhodev thiagocarvalhodev commented Sep 26, 2023

Implement the following packages:
- ardrive_uploader
- ardrive_utils
- ardrive_crypto
- arconnect
- arfs
- use stable version of arweave
- use stable version of the data bundler class
- integrate the uploader with the ardrive app
- add status for the uploads
- integrates the uploader on app
- fixes and minor improvements
Use the new API for tracking the progress of the uploads
move data bundle for its file
uses the new api on the upload streamed request.
- use new api for track progress
- starts the implementation of the folder uploads. Currently, it's disabled.
- fixes the conflict resolution reusing the id
@thiagocarvalhodev thiagocarvalhodev self-assigned this Sep 26, 2023
SecretKey? driveKey,
required UploadType type,
}) async {
print('Creating a new upload controller using the upload type $type');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the debugPrint method instead

required UploadType type,
}) async {
print('Creating a new upload controller using the upload type $type');

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to create the logger package

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally packages would automagically take the logger instance from the app. Without that the params and exporting would not work as expected.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but we can't import the app into the packages, we will end with a circular dependency. What we can do, is to create the logger and only instantiate it on the web app.

final Uri _turboUploadUri;

@override
Future<UploadController> upload({
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not sending the bdi for the upload

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

);

/// folders always are generated in the first BDI.
final bundleForFolders = bundle.first;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review it

Future<void> close();
void cancel();
void onCancel();
void onDone(Function(List<UploadTask> tasks) callback);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming these methods


_onProgressChange!(event);

if (_uploadProgress.progress == 1) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider implementing a helper method instead of comparing the progress with 1

Comment on lines +12 to +13
final webBundleSizeLimit = const MiB(65000).size;
final mobileBundleSizeLimit = const MiB(65000).size;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no bundle limit. We have a 64GiB limit for private files giving we reuse the same nonce.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation, @karlprieb !

@@ -0,0 +1,84 @@
// import 'package:ardrive/services/arweave/graphql/graphql_api.graphql.dart';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use this file anymore.
Instead of removing this file, I'll add a TODO explaining that this class is coupled with the ArweaveService and TransactionCommonMixin classes.

When we remove this dependency, we can use this class in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(handle.uploadItem as TransactionUploadTask).data)
.run();

progressStreamTask.match((l) => print(''), (progressStream) async {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should handle left here

final bundledDataItem = await (await createBundledDataItem).run();

return bundledDataItem.match((l) {
// TODO: handle error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to handle error

final bundledDataItem = await (await createBundledDataItem).run();

return bundledDataItem.match((l) {
// TODO: handle error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handle error

@thiagocarvalhodev thiagocarvalhodev merged commit 1548f09 into dev Oct 6, 2023
@thiagocarvalhodev thiagocarvalhodev deleted the PE-3699-uploads-large-files-for-public-drives branch October 6, 2023 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants