From 111d8d6ad1a1afd6c8e9561d26e55ab1e74fcb42 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Wed, 6 Apr 2022 05:56:09 -0700 Subject: [PATCH] Functions and Storage deprecated Error variables (#9569) * Functions and Storage deprecated Error variables * Test build fixes * one more test build issue * Review * style --- FirebaseFunctions/CHANGELOG.md | 4 ++++ FirebaseFunctions/Sources/FIRFunctions+Internal.h | 6 ++++++ FirebaseFunctions/Sources/FIRFunctions.m | 4 ++-- FirebaseFunctions/Sources/FUNError.m | 8 +++++--- FirebaseFunctions/Sources/FUNSerializer.m | 3 ++- .../Sources/Public/FirebaseFunctions/FIRError.h | 10 +++++++--- .../Tests/Integration/FIRIntegrationTests.m | 4 ++-- .../Tests/SwiftIntegration/IntegrationTests.swift | 8 ++++---- FirebaseFunctions/Tests/Unit/FUNSerializerTests.m | 2 +- FirebaseFunctionsSwift/Tests/IntegrationTests.swift | 8 ++++---- FirebaseStorage/CHANGELOG.md | 4 ++++ FirebaseStorage/Sources/FIRStorageConstants.m | 1 + FirebaseStorage/Sources/FIRStorageErrors.h | 2 ++ FirebaseStorage/Sources/FIRStorageErrors.m | 6 ++++-- FirebaseStorage/Sources/FIRStorageUploadTask.m | 2 +- FirebaseStorage/Sources/FIRStorageUtils.m | 2 +- .../Public/FirebaseStorage/FIRStorageConstants.h | 5 ++++- FirebaseStorage/Tests/Unit/FIRStorageReferenceTests.m | 8 ++++++-- .../Tests/Unit/FIRStorageTokenAuthorizerTests.m | 6 ++++++ 19 files changed, 66 insertions(+), 27 deletions(-) diff --git a/FirebaseFunctions/CHANGELOG.md b/FirebaseFunctions/CHANGELOG.md index 32721fdcdc3..0f9edfd76c8 100644 --- a/FirebaseFunctions/CHANGELOG.md +++ b/FirebaseFunctions/CHANGELOG.md @@ -1,3 +1,7 @@ +# v8.15.0 +- [deprecated] The global variables `FIRFunctionsErrorDomain` and `FIRFunctionsErrorDetailsKey` are + deprecated and will be removed in v9.0.0. (#9569) + # v8.9.0 - [fixed] Add watchOS support for Swift Package Manager (#8864). diff --git a/FirebaseFunctions/Sources/FIRFunctions+Internal.h b/FirebaseFunctions/Sources/FIRFunctions+Internal.h index 655338d4667..18d2918c4ac 100644 --- a/FirebaseFunctions/Sources/FIRFunctions+Internal.h +++ b/FirebaseFunctions/Sources/FIRFunctions+Internal.h @@ -66,4 +66,10 @@ NS_ASSUME_NONNULL_BEGIN @end +// The error domain for codes in the FIRFunctionsErrorCode enum. +FOUNDATION_EXPORT NSString *const FIRFunctionsErrorDomainInternal; + +// The key for finding error details in the NSError userInfo. +FOUNDATION_EXPORT NSString *const FIRFunctionsErrorDetailsKeyInternal; + NS_ASSUME_NONNULL_END diff --git a/FirebaseFunctions/Sources/FIRFunctions.m b/FirebaseFunctions/Sources/FIRFunctions.m index 7738147fa38..3d9a91f9f04 100644 --- a/FirebaseFunctions/Sources/FIRFunctions.m +++ b/FirebaseFunctions/Sources/FIRFunctions.m @@ -296,7 +296,7 @@ - (void)callFunction:(NSString *)name } if (![responseJSON isKindOfClass:[NSDictionary class]]) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey : @"Response was not a dictionary."}; - error = [NSError errorWithDomain:FIRFunctionsErrorDomain + error = [NSError errorWithDomain:FIRFunctionsErrorDomainInternal code:FIRFunctionsErrorCodeInternal userInfo:userInfo]; if (completion) { @@ -311,7 +311,7 @@ - (void)callFunction:(NSString *)name } if (!dataJSON) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey : @"Response is missing data field."}; - error = [NSError errorWithDomain:FIRFunctionsErrorDomain + error = [NSError errorWithDomain:FIRFunctionsErrorDomainInternal code:FIRFunctionsErrorCodeInternal userInfo:userInfo]; if (completion) { diff --git a/FirebaseFunctions/Sources/FUNError.m b/FirebaseFunctions/Sources/FUNError.m index 81e283b0797..8567c0d3d29 100644 --- a/FirebaseFunctions/Sources/FUNError.m +++ b/FirebaseFunctions/Sources/FUNError.m @@ -20,7 +20,9 @@ NS_ASSUME_NONNULL_BEGIN NSString *const FIRFunctionsErrorDomain = @"com.firebase.functions"; +NSString *const FIRFunctionsErrorDomainInternal = @"com.firebase.functions"; NSString *const FIRFunctionsErrorDetailsKey = @"details"; +NSString *const FIRFunctionsErrorDetailsKeyInternal = @"details"; /** * Takes an HTTP status code and returns the corresponding FIRFunctionsErrorCode error code. @@ -138,7 +140,7 @@ FIRFunctionsErrorCode FIRFunctionsErrorCodeForHTTPStatus(NSInteger status) { NSError *_Nullable FUNErrorForCode(FIRFunctionsErrorCode code) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey : FUNDescriptionForErrorCode(code)}; - return [NSError errorWithDomain:FIRFunctionsErrorDomain code:code userInfo:userInfo]; + return [NSError errorWithDomain:FIRFunctionsErrorDomainInternal code:code userInfo:userInfo]; } NSError *_Nullable FUNErrorForResponse(NSInteger status, @@ -188,9 +190,9 @@ FIRFunctionsErrorCode FIRFunctionsErrorCodeForHTTPStatus(NSInteger status) { NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; userInfo[NSLocalizedDescriptionKey] = description; if (details) { - userInfo[FIRFunctionsErrorDetailsKey] = details; + userInfo[FIRFunctionsErrorDetailsKeyInternal] = details; } - return [NSError errorWithDomain:FIRFunctionsErrorDomain code:code userInfo:userInfo]; + return [NSError errorWithDomain:FIRFunctionsErrorDomainInternal code:code userInfo:userInfo]; } NS_ASSUME_NONNULL_END diff --git a/FirebaseFunctions/Sources/FUNSerializer.m b/FirebaseFunctions/Sources/FUNSerializer.m index c776f5968ea..fe72993ec4b 100644 --- a/FirebaseFunctions/Sources/FUNSerializer.m +++ b/FirebaseFunctions/Sources/FUNSerializer.m @@ -14,6 +14,7 @@ #import "FirebaseFunctions/Sources/FUNSerializer.h" +#import "FirebaseFunctions/Sources/FIRFunctions+Internal.h" #import "FirebaseFunctions/Sources/FUNUsageValidation.h" #import "FirebaseFunctions/Sources/Public/FirebaseFunctions/FIRError.h" @@ -137,7 +138,7 @@ - (id)encode:(id)object { NSDictionary *userInfo = @{ NSLocalizedDescriptionKey : description, }; - return [NSError errorWithDomain:FIRFunctionsErrorDomain + return [NSError errorWithDomain:FIRFunctionsErrorDomainInternal code:FIRFunctionsErrorCodeInternal userInfo:userInfo]; } diff --git a/FirebaseFunctions/Sources/Public/FirebaseFunctions/FIRError.h b/FirebaseFunctions/Sources/Public/FirebaseFunctions/FIRError.h index 6a5626c5f3d..34ed2489a0b 100644 --- a/FirebaseFunctions/Sources/Public/FirebaseFunctions/FIRError.h +++ b/FirebaseFunctions/Sources/Public/FirebaseFunctions/FIRError.h @@ -17,13 +17,17 @@ NS_ASSUME_NONNULL_BEGIN // The error domain for codes in the FIRFunctionsErrorCode enum. -FOUNDATION_EXPORT NSString *const FIRFunctionsErrorDomain NS_SWIFT_NAME(FunctionsErrorDomain); +FOUNDATION_EXPORT NSString *const FIRFunctionsErrorDomain NS_SWIFT_NAME(FunctionsErrorDomain) + DEPRECATED_MSG_ATTRIBUTE("The variable will be unavailable in a future release," + " but the string will not change."); // The key for finding error details in the NSError userInfo. // clang-format off -// clang-format12 merges the next two lines. +// clang-format14 merges the next two lines. FOUNDATION_EXPORT NSString *const FIRFunctionsErrorDetailsKey - NS_SWIFT_NAME(FunctionsErrorDetailsKey); + NS_SWIFT_NAME(FunctionsErrorDetailsKey) + DEPRECATED_MSG_ATTRIBUTE("The variable will be unavailable from Objective C in a future release," + " but the string will not change."); // clang-format on /** diff --git a/FirebaseFunctions/Tests/Integration/FIRIntegrationTests.m b/FirebaseFunctions/Tests/Integration/FIRIntegrationTests.m index 80177ae3c9f..1ec59b49c96 100644 --- a/FirebaseFunctions/Tests/Integration/FIRIntegrationTests.m +++ b/FirebaseFunctions/Tests/Integration/FIRIntegrationTests.m @@ -208,7 +208,7 @@ - (void)testExplicitError { XCTAssertEqual(FIRFunctionsErrorCodeOutOfRange, error.code); XCTAssertEqualObjects(@"explicit nope", error.userInfo[NSLocalizedDescriptionKey]); NSDictionary *expectedDetails = @{@"start" : @10, @"end" : @20, @"long" : @30L}; - XCTAssertEqualObjects(expectedDetails, error.userInfo[FIRFunctionsErrorDetailsKey]); + XCTAssertEqualObjects(expectedDetails, error.userInfo[@"details"]); [expectation fulfill]; }]; [self waitForExpectations:@[ expectation ] timeout:10]; @@ -235,7 +235,7 @@ - (void)testTimeout { XCTAssertNotNil(error); XCTAssertEqual(FIRFunctionsErrorCodeDeadlineExceeded, error.code); XCTAssertEqualObjects(@"DEADLINE EXCEEDED", error.userInfo[NSLocalizedDescriptionKey]); - XCTAssertNil(error.userInfo[FIRFunctionsErrorDetailsKey]); + XCTAssertNil(error.userInfo[@"details"]); [expectation fulfill]; }]; [self waitForExpectations:@[ expectation ] timeout:10]; diff --git a/FirebaseFunctions/Tests/SwiftIntegration/IntegrationTests.swift b/FirebaseFunctions/Tests/SwiftIntegration/IntegrationTests.swift index 4c9479026dc..b7a3e095f8d 100644 --- a/FirebaseFunctions/Tests/SwiftIntegration/IntegrationTests.swift +++ b/FirebaseFunctions/Tests/SwiftIntegration/IntegrationTests.swift @@ -377,7 +377,7 @@ class IntegrationTests: XCTestCase { XCTAssertEqual(FunctionsErrorCode.outOfRange.rawValue, error.code) XCTAssertEqual("explicit nope", error.localizedDescription) XCTAssertEqual(["start": 10 as Int32, "end": 20 as Int32, "long": 30], - error.userInfo[FunctionsErrorDetailsKey] as! [String: Int32]) + error.userInfo["details"] as! [String: Int32]) expectation.fulfill() } catch { XCTAssert(false, "Failed to unwrap the function result: \(error)") @@ -399,7 +399,7 @@ class IntegrationTests: XCTestCase { XCTAssertEqual(FunctionsErrorCode.outOfRange.rawValue, error.code) XCTAssertEqual("explicit nope", error.localizedDescription) XCTAssertEqual(["start": 10 as Int32, "end": 20 as Int32, "long": 30], - error.userInfo[FunctionsErrorDetailsKey] as! [String: Int32]) + error.userInfo["details"] as! [String: Int32]) return } XCTAssertFalse(true, "Failed to throw error for missing result") @@ -451,7 +451,7 @@ class IntegrationTests: XCTestCase { let error = try XCTUnwrap(error! as NSError) XCTAssertEqual(FunctionsErrorCode.deadlineExceeded.rawValue, error.code) XCTAssertEqual("DEADLINE EXCEEDED", error.localizedDescription) - XCTAssertNil(error.userInfo[FunctionsErrorDetailsKey]) + XCTAssertNil(error.userInfo["details"]) expectation.fulfill() } catch { XCTAssert(false, "Failed to unwrap the function result: \(error)") @@ -473,7 +473,7 @@ class IntegrationTests: XCTestCase { let error = try XCTUnwrap(error) as NSError XCTAssertEqual(FunctionsErrorCode.deadlineExceeded.rawValue, error.code) XCTAssertEqual("DEADLINE EXCEEDED", error.localizedDescription) - XCTAssertNil(error.userInfo[FunctionsErrorDetailsKey]) + XCTAssertNil(error.userInfo["details"]) return } XCTAssertFalse(true, "Failed to throw error for missing result") diff --git a/FirebaseFunctions/Tests/Unit/FUNSerializerTests.m b/FirebaseFunctions/Tests/Unit/FUNSerializerTests.m index 510d71dde74..145461a738d 100644 --- a/FirebaseFunctions/Tests/Unit/FUNSerializerTests.m +++ b/FirebaseFunctions/Tests/Unit/FUNSerializerTests.m @@ -88,7 +88,7 @@ - (void)testDecodeInvalidLong { NSNumber *actual = [serializer decode:input error:&error]; XCTAssertNil(actual); XCTAssertNotNil(error); - XCTAssertEqualObjects(FIRFunctionsErrorDomain, error.domain); + XCTAssertEqualObjects(@"com.firebase.functions", error.domain); XCTAssertEqual(FIRFunctionsErrorCodeInternal, error.code); } diff --git a/FirebaseFunctionsSwift/Tests/IntegrationTests.swift b/FirebaseFunctionsSwift/Tests/IntegrationTests.swift index bf73e641207..6695764acfc 100644 --- a/FirebaseFunctionsSwift/Tests/IntegrationTests.swift +++ b/FirebaseFunctionsSwift/Tests/IntegrationTests.swift @@ -429,7 +429,7 @@ class IntegrationTests: XCTestCase { XCTAssertEqual(FunctionsErrorCode.outOfRange.rawValue, error.code) XCTAssertEqual("explicit nope", error.localizedDescription) XCTAssertEqual(["start": 10 as Int32, "end": 20 as Int32, "long": 30], - error.userInfo[FunctionsErrorDetailsKey] as! [String: Int32]) + error.userInfo["details"] as! [String: Int32]) expectation.fulfill() return } @@ -454,7 +454,7 @@ class IntegrationTests: XCTestCase { XCTAssertEqual(FunctionsErrorCode.outOfRange.rawValue, error.code) XCTAssertEqual("explicit nope", error.localizedDescription) XCTAssertEqual(["start": 10 as Int32, "end": 20 as Int32, "long": 30], - error.userInfo[FunctionsErrorDetailsKey] as! [String: Int32]) + error.userInfo["details"] as! [String: Int32]) } } #endif @@ -514,7 +514,7 @@ class IntegrationTests: XCTestCase { let error = error as NSError XCTAssertEqual(FunctionsErrorCode.deadlineExceeded.rawValue, error.code) XCTAssertEqual("DEADLINE EXCEEDED", error.localizedDescription) - XCTAssertNil(error.userInfo[FunctionsErrorDetailsKey]) + XCTAssertNil(error.userInfo["details"]) expectation.fulfill() return } @@ -539,7 +539,7 @@ class IntegrationTests: XCTestCase { let error = error as NSError XCTAssertEqual(FunctionsErrorCode.deadlineExceeded.rawValue, error.code) XCTAssertEqual("DEADLINE EXCEEDED", error.localizedDescription) - XCTAssertNil(error.userInfo[FunctionsErrorDetailsKey]) + XCTAssertNil(error.userInfo["details"]) } } #endif diff --git a/FirebaseStorage/CHANGELOG.md b/FirebaseStorage/CHANGELOG.md index 831de37cfd2..ad52749a6fd 100644 --- a/FirebaseStorage/CHANGELOG.md +++ b/FirebaseStorage/CHANGELOG.md @@ -1,3 +1,7 @@ +# 8.15.0 +- [deprecated] The global variable `FIRStorageErrorDomain` is deprecated and will + be removed in a future release (#9569). + # 8.5.0 - [fixed] Fixed an issue where Storage could not connect to local emulators using http (#8389). diff --git a/FirebaseStorage/Sources/FIRStorageConstants.m b/FirebaseStorage/Sources/FIRStorageConstants.m index 786d17f126f..4dc8e336fb9 100644 --- a/FirebaseStorage/Sources/FIRStorageConstants.m +++ b/FirebaseStorage/Sources/FIRStorageConstants.m @@ -39,6 +39,7 @@ NSString *const kFIRStorageResponseBody = @"ResponseBody"; NSString *const FIRStorageErrorDomain = @"FIRStorageErrorDomain"; +NSString *const FIRStorageErrorDomainInternal = @"FIRStorageErrorDomain"; NSString *const kFIRStorageInvalidDataFormat = @"Invalid data returned from the server: %@"; NSString *const kFIRStorageInvalidObserverStatus = diff --git a/FirebaseStorage/Sources/FIRStorageErrors.h b/FirebaseStorage/Sources/FIRStorageErrors.h index 86dca47e35c..42519aa0b59 100644 --- a/FirebaseStorage/Sources/FIRStorageErrors.h +++ b/FirebaseStorage/Sources/FIRStorageErrors.h @@ -67,4 +67,6 @@ NS_ASSUME_NONNULL_BEGIN @end +FOUNDATION_EXPORT NSString *const FIRStorageErrorDomainInternal; + NS_ASSUME_NONNULL_END diff --git a/FirebaseStorage/Sources/FIRStorageErrors.m b/FirebaseStorage/Sources/FIRStorageErrors.m index 1e5b4254657..031e378d564 100644 --- a/FirebaseStorage/Sources/FIRStorageErrors.m +++ b/FirebaseStorage/Sources/FIRStorageErrors.m @@ -113,7 +113,9 @@ + (NSError *)errorWithCode:(FIRStorageErrorCode)code errorDictionary[NSLocalizedDescriptionKey] = errorMessage; - NSError *err = [NSError errorWithDomain:FIRStorageErrorDomain code:code userInfo:errorDictionary]; + NSError *err = [NSError errorWithDomain:FIRStorageErrorDomainInternal + code:code + userInfo:errorDictionary]; return err; } @@ -182,7 +184,7 @@ + (NSError *)errorWithInvalidRequest:(NSData *)request { } + (NSError *)errorWithCustomMessage:(NSString *)errorMessage { - return [NSError errorWithDomain:FIRStorageErrorDomain + return [NSError errorWithDomain:FIRStorageErrorDomainInternal code:FIRStorageErrorCodeUnknown userInfo:@{NSLocalizedDescriptionKey : errorMessage}]; } diff --git a/FirebaseStorage/Sources/FIRStorageUploadTask.m b/FirebaseStorage/Sources/FIRStorageUploadTask.m index a73f9364251..3b3d455425c 100644 --- a/FirebaseStorage/Sources/FIRStorageUploadTask.m +++ b/FirebaseStorage/Sources/FIRStorageUploadTask.m @@ -212,7 +212,7 @@ - (BOOL)isContentToUploadValid:(NSError **)outError { userInfo[NSUnderlyingErrorKey] = fileReachabilityError; } - *outError = [NSError errorWithDomain:FIRStorageErrorDomain + *outError = [NSError errorWithDomain:FIRStorageErrorDomainInternal code:FIRStorageErrorCodeUnknown userInfo:userInfo]; } diff --git a/FirebaseStorage/Sources/FIRStorageUtils.m b/FirebaseStorage/Sources/FIRStorageUtils.m index abf24f6e21a..c5a0974805c 100644 --- a/FirebaseStorage/Sources/FIRStorageUtils.m +++ b/FirebaseStorage/Sources/FIRStorageUtils.m @@ -133,7 +133,7 @@ + (NSString *)encodedURLForPath:(FIRStoragePath *)path { } + (NSError *)storageErrorWithDescription:(NSString *)description code:(NSInteger)code { - return [NSError errorWithDomain:FIRStorageErrorDomain + return [NSError errorWithDomain:FIRStorageErrorDomainInternal code:code userInfo:@{NSLocalizedDescriptionKey : description}]; } diff --git a/FirebaseStorage/Sources/Public/FirebaseStorage/FIRStorageConstants.h b/FirebaseStorage/Sources/Public/FirebaseStorage/FIRStorageConstants.h index 52c738268f1..be56e2211db 100644 --- a/FirebaseStorage/Sources/Public/FirebaseStorage/FIRStorageConstants.h +++ b/FirebaseStorage/Sources/Public/FirebaseStorage/FIRStorageConstants.h @@ -112,7 +112,10 @@ typedef NS_ENUM(NSInteger, FIRStorageTaskStatus) { /** * Firebase Storage error domain. */ -FOUNDATION_EXPORT NSString *const FIRStorageErrorDomain NS_SWIFT_NAME(StorageErrorDomain); +FOUNDATION_EXPORT NSString *const FIRStorageErrorDomain NS_SWIFT_NAME(StorageErrorDomain) + DEPRECATED_MSG_ATTRIBUTE( + "The variable will be unavailable from Objective C in a future release," + " but the string will not change."); /** * Enum representing the errors raised by Firebase Storage. diff --git a/FirebaseStorage/Tests/Unit/FIRStorageReferenceTests.m b/FirebaseStorage/Tests/Unit/FIRStorageReferenceTests.m index 6fe8b50cd2e..0a2d2dfe0e3 100644 --- a/FirebaseStorage/Tests/Unit/FIRStorageReferenceTests.m +++ b/FirebaseStorage/Tests/Unit/FIRStorageReferenceTests.m @@ -176,8 +176,10 @@ - (void)testReferenceWithNonExistentFileFailsWithCompletion { [expectation fulfill]; XCTAssertNotNil(error); XCTAssertNil(metadata); - +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" XCTAssertEqualObjects(error.domain, FIRStorageErrorDomain); +#pragma clang diagnostic pop XCTAssertEqual(error.code, FIRStorageErrorCodeUnknown); NSString *expectedDescription = [NSString stringWithFormat:@"File at URL: %@ is not reachable. " @@ -203,8 +205,10 @@ - (void)testReferenceWithNilFileURLFailsWithCompletion { [expectation fulfill]; XCTAssertNotNil(error); XCTAssertNil(metadata); - +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" XCTAssertEqualObjects(error.domain, FIRStorageErrorDomain); +#pragma clang diagnostic pop XCTAssertEqual(error.code, FIRStorageErrorCodeUnknown); NSString *expectedDescription = [NSString stringWithFormat:@"File at URL: %@ is not reachable. " diff --git a/FirebaseStorage/Tests/Unit/FIRStorageTokenAuthorizerTests.m b/FirebaseStorage/Tests/Unit/FIRStorageTokenAuthorizerTests.m index c7ead5c1c41..698135084b0 100644 --- a/FirebaseStorage/Tests/Unit/FIRStorageTokenAuthorizerTests.m +++ b/FirebaseStorage/Tests/Unit/FIRStorageTokenAuthorizerTests.m @@ -86,9 +86,12 @@ - (void)testSuccessfulAuth { - (void)testUnsuccessfulAuth { XCTestExpectation *expectation = [self expectationWithDescription:@"testUnsuccessfulAuth"]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" NSError *authError = [NSError errorWithDomain:FIRStorageErrorDomain code:FIRStorageErrorCodeUnauthenticated userInfo:nil]; +#pragma clang diagnostic pop FIRAuthInteropFake *failedAuth = [[FIRAuthInteropFake alloc] initWithToken:nil userID:nil error:authError]; @@ -109,7 +112,10 @@ - (void)testUnsuccessfulAuth { NSDictionary *headers = self.fetcher.request.allHTTPHeaderFields; NSString *authHeader = [headers objectForKey:@"Authorization"]; XCTAssertNil(authHeader); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" XCTAssertEqualObjects(error.domain, FIRStorageErrorDomain); +#pragma clang diagnostic pop XCTAssertEqual(error.code, FIRStorageErrorCodeUnauthenticated); [expectation fulfill]; }];