-
Notifications
You must be signed in to change notification settings - Fork 4k
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
refactor: Migrate Firebase Storage to nnbd #4753
Conversation
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
: super(appInstance: app, bucket: bucket); | ||
|
||
/// The js-interop layer for Firebase Storage | ||
final storage_interop.Storage? webStorage; |
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.
This is nullable. This is the same as auth web. although it violate that principle you mentioned yesterday, @Salakar. It's only nullable to satisfy registerWith
. I wonder if it is necessary.
@@ -17,7 +15,7 @@ class TaskSnapshotWeb extends TaskSnapshotPlatform { | |||
ReferencePlatform ref, storage_interop.UploadTaskSnapshot snapshot) | |||
: _reference = ref, | |||
_snapshot = snapshot, | |||
super(fbTaskStateToTaskState(snapshot.state), null); | |||
super(fbTaskStateToTaskState(snapshot.state), {}); |
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.
passed in empty Map literal otherwise it's an error. not sure if this is ideal.
} else { | ||
return {}; | ||
} | ||
} |
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.
I updated all this logic because this: dartify(jsObject.customMetadata) as Map
can easily be null
which didn't cause a static analysis error when casting, but if I ran it this code in dartpad, it did:
var map = null;
var thing = (map as Map).cast<String, String>();
thing['stuff'] = "foo";
I also returned empty Map literal. If make the getter type nullable (Map<String, String>? get customMetadata
), we also have to make the setter param nullable ( set customMetadata(Map<String, String>? m)
). Didn't seem right, happy to change though.
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
// A bucket must exist at this point | ||
// TODO(ehesp): Check whether `app.options.storageBucket` can be nullable post migration | ||
if (bucket == null) { | ||
if (bucket == null && app.options.storageBucket == null) { |
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.
I updated this code to be a bit more clear about what is happening. bucket
and app.options.storageBucket
are nullable. If both are null
, throw an error.
_bucket
initialization occurs here
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
packages/firebase_storage/firebase_storage/test/firebase_storage_test.dart
Outdated
Show resolved
Hide resolved
packages/firebase_storage/firebase_storage/example/lib/main.dart
Outdated
Show resolved
Hide resolved
packages/firebase_storage/firebase_storage/lib/src/firebase_storage.dart
Outdated
Show resolved
Hide resolved
packages/firebase_storage/firebase_storage/lib/src/firebase_storage.dart
Outdated
Show resolved
Hide resolved
packages/firebase_storage/firebase_storage/lib/src/reference.dart
Outdated
Show resolved
Hide resolved
packages/firebase_storage/firebase_storage/lib/src/reference.dart
Outdated
Show resolved
Hide resolved
packages/firebase_storage/firebase_storage/test/firebase_storage_test.dart
Outdated
Show resolved
Hide resolved
...base_storage/firebase_storage_platform_interface/lib/src/method_channel/utils/exception.dart
Outdated
Show resolved
Hide resolved
I had to remove
This is the relevant commit. Not really sure why it is casting to a different type, apparently no documentation on I also commented out a test, it is supposed to error but it doesn't. This just needs confirmation on expected behaviour, and is included as part of the ticket. Internal ticket: INVERTASE/FF-29 |
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.
Some unused dependencies
packages/firebase_storage/firebase_storage_platform_interface/pubspec.yaml
Outdated
Show resolved
Hide resolved
Co-authored-by: Mike Diarmid <[email protected]>
This PR: #5014 ought to be merged into this PR first to fix a number of issues described in the description. |
Description
NNBD migration work for Firebase Storage.
Related Issues
Replace this paragraph with a list of issues related to this PR from the issue database. Indicate, which of these issues are resolved or fixed by this PR. Note that you'll have to prefix the issue numbers with flutter/flutter#.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process. Updating the
pubspec.yaml
and changelogs is not required.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?