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

Show progress when “downloading” a file #276

Closed
2 tasks done
ericswpark opened this issue Nov 12, 2022 · 4 comments
Closed
2 tasks done

Show progress when “downloading” a file #276

ericswpark opened this issue Nov 12, 2022 · 4 comments
Assignees
Labels
type:feature-request New feature or request
Milestone

Comments

@ericswpark
Copy link

Please agree to the following

Summary

Show progress in the iOS Files app while “downloading” a file

Motivation

Right now a spinning progress indicator is all that users get when “downloading” (download+decrypt) a large file off of a Cryptomator vault. This change should allow the user to see what Cryptomator is currently doing (is it downloading from the backend provider? Is it decrypting the file?), making the experience better for users by not having them guess and wait.

Considered Alternatives

No alternatives AFAIK

Anything else?

No response

@ericswpark ericswpark added the type:feature-request New feature or request label Nov 12, 2022
@phil1995
Copy link
Collaborator

In order to show a download progress we need to provide an URLSessionDownloadTask to the FileProviderExtension. We already talked about some solutions in the past but I want to take the chance to share some thoughts about the (in my opinion) most likely one in public.

We could modify the CloudProvider protocol in order to optionally get an URLSessionDownloadTask when starting a download. We need to make this optional since some providers like the LocalFileSystemProvider which we use for the LocalFileSystem and iCloud Drive (and maybe to access other file providers like SMB or 3rd party) rely on the FileManager which do not uses an URLSessionDownloadTask.

But this comes with some serious refactoring in order to pass the task through the layers. And also getting the underlying URLSessionDownloadTask from the 3rd party SDKs could be not trivial. We could start with the WebDAVProvider since it's the one which we implemented by ourself and getting the URLSessionDownloadTask is indeed trivial and if I remember it correctly I already got the download progress working in a previous PoC.

@ericswpark
Copy link
Author

@phil1995 thank you for the reply. I don't know iOS development enough to try it myself, but would like to ask: for the providers that do not support URLSessionDownloadTask, how possible is it to add some sort of "shim" between the layers so it gives status updates to the FileProviderExtension?

@phil1995
Copy link
Collaborator

We haven't found a way to create some sort of "fake" URLSessionDownloadTask which the FileProviderExtension actually accepted and read the progress in order to display it. I think the only way to support progress for those providers would be to use the NSReplicatedFileProviderExtension which has been introduced with iOS 16 and has a different API and does not need an URLSessionDownloadTask. However, as the API and behavior is different from the "normal" FileProviderExtension and relies a lot more on the WorkingSet and Push Notifications to notify the FileProviderExtension about changes on the cloud side, I wouldn't consider this as an option in the short term and further investigations are needed to check if it's feasible at all.

Hope this adds some context to the whole problem of the download progress.

One rather dirty workaround that came to my mind would be to add a custom option like "show download progress" as we have it for the manual retry failed upload.

@phil1995 phil1995 self-assigned this Jan 1, 2023
@tobihagemann tobihagemann added this to the 2.4.4 milestone Jan 16, 2023
@tobihagemann
Copy link
Member

Fixed in #293. We're aware that only some cloud storage providers are supported at the moment but we will add support for other providers gradually (and create separate issues).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants