-
Notifications
You must be signed in to change notification settings - Fork 19
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-6751: fixes autoupdate manifest payment selector #1890
PE-6751: fixes autoupdate manifest payment selector #1890
Conversation
- automatically start the upload if all manifest are free to upload
Visit the preview URL for this PR (updated for commit 0e62c9d): https://ardrive-web--pr1890-pe-6751-fixes-autoup-sphth8df.web.app (expires Tue, 22 Oct 2024 19:19:12 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: a224ebaee2f0939e7665e7630e7d3d6cd7d0f8b0 |
lib/blocs/upload/upload_cubit.dart
Outdated
if (!isTest) { | ||
await Future.delayed(const Duration(milliseconds: 100)); | ||
} |
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.
whats up with this?
lib/blocs/upload/upload_cubit.dart
Outdated
await Future.delayed(const Duration(milliseconds: 100)); | ||
|
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.
a pattern i see, hmmmmm
} | ||
if (tasks.first is FileUploadTask) { | ||
await _postUploadFile( | ||
task: tasks.first as FileUploadTask, |
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.
Casting doesnt seem necessary here
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.
It is.
Dart’s type promotion has limitations:
- Local Variables Only: Type promotion works only with local variables, not with properties, getters, or index accesses. Since tasks.first is a property access (even if tasks is a local variable), type promotion doesn’t apply.
- Immutable Variables: The variable must not be mutated within the scope where the promotion is expected.
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.
Fair enough - maybe could create a local variable with a typeguard - consider having a util for this that returns "FileUploadTask". But not a blocker.
--- Releases ---
Android release: https://appdistribution.firebase.google.com/testerapps/1:305132849030:android:6cf0cd5ec064fad3ffce07/releases/090vj6gqd4gi0