-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support for download via byte stream #20
base: main
Are you sure you want to change the base?
Conversation
(fixed in fetch_api 1.0.1)
Another thing I noticed is that the code is not retrying using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
@@ -5,7 +5,7 @@ publish_to: none | |||
|
|||
environment: | |||
sdk: '>=2.18.5 <3.0.0' | |||
flutter: 3.3.9 | |||
flutter: 3.7.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO for @matibat: check what are the downsides of bumping the version for localizations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYR already fixed a bunch of localisation errors in the ArDrive-web PR
A few problems I encountered that lead me to this particular solution:
Range
header, thearweave.net
gateway will eventually rate limit your requests, even with large chunks. Gateway then does exponential backoff which can seriously impact download time.dio
streams are a lie - it downloads a buffer and wraps it inStream.value
package:http
on web still use XHR requests, also without real stream support: Migrate to thefetch
API dart-lang/http#595So to get around all of these issues:
fetch
on web (usingfetch_client
library instead ofardrive-http.ts
to handle the more complex js/dart interop)HttpClient
on mobile which just worksI've confirmed that the memory usage on web is stable. Not sure how to confirm on mobile
Caveats of this method:
fetch
. Seems that this cannot be fixed: Support for flow control? Zekfad/fetch_client#3