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

v1.4.0 #16

Closed
Closed

Conversation

thiagocarvalhodev
Copy link
Collaborator

@thiagocarvalhodev thiagocarvalhodev commented Sep 26, 2023

Release Notes

Now it's possible to save files as Stream on Android, iOS, and Web.
On the Web, it uses FileSystemAccess when the browser supports it, otherwise, it will use the StreamSaver.

Limitations

  • Max download on Safari: 1GiB

elliotsayes and others added 30 commits February 16, 2023 15:15
"This writable stream writer has been released and cannot be closed"
Used when FileSystemAPI is not available
MobileSelectableFolderFileSaver's FileSaver does not support streams
reason: `extension` is dart reserved keyword (+ more explicit)
- add a method to save files on local app dir - ps: only mobile!
use static version
replace deprecated method
- Changes the implementation of the `listContent()` method to return the first level children of this folder. This behavior is already present on the `IOFolder` running on dart vm.
- Implements a new interface `MutableIOFilePath` that allows the flexibility for change its own path. It is useful for generating the folder tree. `WebFile` now implements this interface.

TODO: implement unit tests
@thiagocarvalhodev thiagocarvalhodev self-assigned this Sep 26, 2023
int progress = data[2];

/// only track the progress of current task id
if (status == DownloadTaskStatus.enqueued) {
controller.sink.add(0);
} else if (status == DownloadTaskStatus.running) {
debugPrint('Download progress: ' + progress.toString());
debugPrint('Download progress: $progress');
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we get rid of this log?

@thiagocarvalhodev thiagocarvalhodev changed the title PE-3699: uploads large files for public drives v1.4.0 Oct 26, 2023
matibat
matibat previously approved these changes Oct 26, 2023
Copy link
Contributor

@matibat matibat left a comment

Choose a reason for hiding this comment

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

Approving with non-blocking comments/suggestions. We can address them in a further tech_debt ticket.

class SaveStatus {
final int bytesSaved;
final int totalBytes;
final bool? saveResult;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the null value have a specific meaning here? Is it different than defaulting to false?

Edit - Having it be null means the download hasn't yet finished.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can rename it to hasFinished or isResultSaved, or similar.

try {
await _fileSaver.save(file);
await _fileSaver.save(file, saveOnAppDirectory: saveOnAppDirectory);
Copy link
Contributor

Choose a reason for hiding this comment

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

We can get rid of this try..catch because it's rethrowing and nothing else.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment for the method below.


counter++;

// TODO: Throw an exception on arbitrarily large counter?
Copy link
Contributor

Choose a reason for hiding this comment

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

Bump.

await writer.readyFuture;
debugPrint('writer ready');

// FIXME: this never ends on Firefox/Safari.
Copy link
Contributor

Choose a reason for hiding this comment

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

Something to do here? - If not then let's remove the comment.

@thiagocarvalhodev thiagocarvalhodev dismissed matibat’s stale review October 26, 2023 18:12

The merge-base changed after approval.

Copy link
Contributor

@matibat matibat left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@matibat matibat left a comment

Choose a reason for hiding this comment

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

:)

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.

4 participants