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
fix(storage): ensure bucket value is used to create FirebaseStorage instance to stop incorrect default bucket usage #11844
Conversation
… reverting back to default bucket
@@ -424,8 +424,6 @@ void setupReferenceTests() { | |||
), | |||
); | |||
}, | |||
// TODO(salakar): Firebase storage emulator incorrectly returns `object-not-found` instead of `unauthorized`. |
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.
Nice
|
||
expect(url, contains('/$secondaryBucket/')); | ||
}, | ||
skip: true, // does Firebase Emulator support custom bucket? |
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.
When was this added? I guess she should have caught it in the previous PR
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 think at the time the e2e tests were written, the emulator did not support a non-default bucket.
Description
https://github.com/firebase/flutterfire/blob/master/packages/firebase_storage/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.java#L290
https://github.com/firebase/flutterfire/blob/master/packages/firebase_storage/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.java#L304
https://github.com/firebase/flutterfire/blob/master/packages/firebase_storage/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.java#L324
https://github.com/firebase/flutterfire/blob/master/packages/firebase_storage/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.java#L346
https://github.com/firebase/flutterfire/blob/master/packages/firebase_storage/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.java#L376
https://github.com/firebase/flutterfire/blob/master/packages/firebase_storage/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.java#L417
https://github.com/firebase/flutterfire/blob/master/packages/firebase_storage/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.java#L445
https://github.com/firebase/flutterfire/blob/master/packages/firebase_storage/firebase_storage/android/src/main/java/io/flutter/plugins/firebase/storage/FlutterFirebaseStoragePlugin.java#L489
1000
if user did not pass it as a value to ListOptions, we set it here to1000
. This is a required parameter on the native SDKs when calling list() on a reference. As it is currently implemented, it would throw aNullPointerException
as it could be null if user didn't updatemaxResults
with a value.As an interesting aside, if the user uses a non-default bucket, you also need to set the emulator for it (true for web, iOS and android). For instance, this would call the Firebase server:
Related Issues
fixes #11805
fixes #11808
fixes #11802
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.///
).melos run 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?