Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add support for updateMetadata #503

Merged
merged 3 commits into from
Apr 23, 2018

Conversation

szakarias
Copy link
Contributor

No description provided.

Copy link
Contributor

@mravn-google mravn-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

FIRStorageReference *ref = [[FIRStorage storage].reference child:path];
[ref updateMetadata:[self buildMetadataFromDictionary:metadataDictionary]
completion:^(FIRStorageMetadata *metadata, NSError *error) {
if (error != nil) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Invert condition?

});

test('invokes correct method', () async {
await ref.getMetadata();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should call updateMetadata and try to change something.

@@ -69,6 +69,15 @@ class StorageReference {
}));
}

/// Updates the metadata associated with this [StorageReference].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document what the method returns.

});

test('returns correct result', () async {
expect((await ref.getMetadata()).name, 'image.jpg');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should call updateMetadata and hopefully reflect that something was changed.

/// Updates the metadata associated with this [StorageReference].
///
/// Returns a [Future] that will complete to the updated [StorageMetadata].
Future<StorageMetadata> updateMetadata(StorageMetadata metadata) async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method ignores fields of metadata that cannot be set by the public StorageMetadata constructor.

Copy link
Contributor

@mravn-google mravn-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@szakarias szakarias merged commit 93d1c24 into flutter:master Apr 23, 2018
slightfoot pushed a commit to slightfoot/plugins that referenced this pull request Jun 5, 2018
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants