Skip to content

Commit 00d735d

Browse files
committed
Revert "Adding Custom Time to FirebaseStorage (#9576)"
This reverts commit 071902b.
1 parent 1793deb commit 00d735d

File tree

9 files changed

+0
-54
lines changed

9 files changed

+0
-54
lines changed

FirebaseStorage/Sources/StorageMetadata.swift

-12
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,6 @@ import FirebaseStorageInternal
9191
}
9292
}
9393

94-
/**
95-
* Custom-Time of the object data.
96-
*/
97-
@objc public var customTime: Date? {
98-
get {
99-
return impl.customTime
100-
}
101-
set(newValue) {
102-
impl.customTime = newValue
103-
}
104-
}
105-
10694
/**
10795
* MD5 hash of the data; encoded using base64.
10896
*/

FirebaseStorage/Tests/Integration/StorageAsyncAwait.swift

-8
Original file line numberDiff line numberDiff line change
@@ -276,14 +276,12 @@ import XCTest
276276

277277
private func assertMetadata(actualMetadata: StorageMetadata,
278278
expectedContentType: String,
279-
expectedCustomTime: Date,
280279
expectedCustomMetadata: [String: String]) {
281280
XCTAssertEqual(actualMetadata.cacheControl, "cache-control")
282281
XCTAssertEqual(actualMetadata.contentDisposition, "content-disposition")
283282
XCTAssertEqual(actualMetadata.contentEncoding, "gzip")
284283
XCTAssertEqual(actualMetadata.contentLanguage, "de")
285284
XCTAssertEqual(actualMetadata.contentType, expectedContentType)
286-
XCTAssertEqual(actualMetadata.customTime, expectedCustomTime)
287285
XCTAssertEqual(actualMetadata.md5Hash?.count, 24)
288286
for (key, value) in expectedCustomMetadata {
289287
XCTAssertEqual(actualMetadata.customMetadata![key], value)
@@ -296,7 +294,6 @@ import XCTest
296294
XCTAssertEqual(actualMetadata.contentEncoding, "identity")
297295
XCTAssertNil(actualMetadata.contentLanguage)
298296
XCTAssertNil(actualMetadata.contentType)
299-
XCTAssertNil(actualMetadata.customTime)
300297
XCTAssertEqual(actualMetadata.md5Hash?.count, 24)
301298
XCTAssertNil(actualMetadata.customMetadata)
302299
}
@@ -310,31 +307,26 @@ import XCTest
310307
metadata.contentEncoding = "gzip"
311308
metadata.contentLanguage = "de"
312309
metadata.contentType = "content-type-a"
313-
metadata.customTime = Date(timeIntervalSince1970: 0)
314310
metadata.customMetadata = ["a": "b"]
315311

316312
let updatedMetadata = try await ref.updateMetadata(metadata)
317313
assertMetadata(actualMetadata: updatedMetadata,
318314
expectedContentType: "content-type-a",
319-
expectedCustomTime: Date(timeIntervalSince1970: 0),
320315
expectedCustomMetadata: ["a": "b"])
321316

322317
let metadata2 = updatedMetadata
323318
metadata2.contentType = "content-type-b"
324-
metadata.customTime = Date(timeIntervalSince1970: 100)
325319
metadata2.customMetadata = ["a": "b", "c": "d"]
326320

327321
let metadata3 = try await ref.updateMetadata(metadata2)
328322
assertMetadata(actualMetadata: metadata3,
329323
expectedContentType: "content-type-b",
330-
expectedCustomTime: Date(timeIntervalSince1970: 100),
331324
expectedCustomMetadata: ["a": "b", "c": "d"])
332325
metadata.cacheControl = nil
333326
metadata.contentDisposition = nil
334327
metadata.contentEncoding = nil
335328
metadata.contentLanguage = nil
336329
metadata.contentType = nil
337-
metadata.customTime = nil
338330
metadata.customMetadata = nil
339331
let metadata4 = try await ref.updateMetadata(metadata)
340332
XCTAssertNotNil(metadata4)

FirebaseStorage/Tests/Integration/StorageIntegration.swift

-8
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,12 @@ class StorageResultTests: StorageIntegrationCommon {
417417

418418
private func assertMetadata(actualMetadata: StorageMetadata,
419419
expectedContentType: String,
420-
expectedCustomTime: Date,
421420
expectedCustomMetadata: [String: String]) {
422421
XCTAssertEqual(actualMetadata.cacheControl, "cache-control")
423422
XCTAssertEqual(actualMetadata.contentDisposition, "content-disposition")
424423
XCTAssertEqual(actualMetadata.contentEncoding, "gzip")
425424
XCTAssertEqual(actualMetadata.contentLanguage, "de")
426425
XCTAssertEqual(actualMetadata.contentType, expectedContentType)
427-
XCTAssertEqual(actualMetadata.customTime, expectedCustomTime)
428426
XCTAssertEqual(actualMetadata.md5Hash?.count, 24)
429427
for (key, value) in expectedCustomMetadata {
430428
XCTAssertEqual(actualMetadata.customMetadata![key], value)
@@ -437,7 +435,6 @@ class StorageResultTests: StorageIntegrationCommon {
437435
XCTAssertEqual(actualMetadata.contentEncoding, "identity")
438436
XCTAssertNil(actualMetadata.contentLanguage)
439437
XCTAssertNil(actualMetadata.contentType)
440-
XCTAssertNil(actualMetadata.customTime)
441438
XCTAssertEqual(actualMetadata.md5Hash?.count, 24)
442439
XCTAssertNil(actualMetadata.customMetadata)
443440
}
@@ -452,7 +449,6 @@ class StorageResultTests: StorageIntegrationCommon {
452449
metadata.contentEncoding = "gzip"
453450
metadata.contentLanguage = "de"
454451
metadata.contentType = "content-type-a"
455-
metadata.customTime = Date(timeIntervalSince1970: 0)
456452
metadata.customMetadata = ["a": "b"]
457453

458454
ref.updateMetadata(metadata) { updatedMetadata, error in
@@ -464,27 +460,23 @@ class StorageResultTests: StorageIntegrationCommon {
464460
}
465461
self.assertMetadata(actualMetadata: updatedMetadata,
466462
expectedContentType: "content-type-a",
467-
expectedCustomTime: Date(timeIntervalSince1970: 0),
468463
expectedCustomMetadata: ["a": "b"])
469464

470465
let metadata = updatedMetadata
471466
metadata.contentType = "content-type-b"
472-
metadata.customTime = Date(timeIntervalSince1970: 100)
473467
metadata.customMetadata = ["a": "b", "c": "d"]
474468

475469
ref.updateMetadata(metadata) { result in
476470
switch result {
477471
case let .success(updatedMetadata):
478472
self.assertMetadata(actualMetadata: updatedMetadata,
479473
expectedContentType: "content-type-b",
480-
expectedCustomTime: Date(timeIntervalSince1970: 100),
481474
expectedCustomMetadata: ["a": "b", "c": "d"])
482475
metadata.cacheControl = nil
483476
metadata.contentDisposition = nil
484477
metadata.contentEncoding = nil
485478
metadata.contentLanguage = nil
486479
metadata.contentType = nil
487-
metadata.customTime = nil
488480
metadata.customMetadata = nil
489481
ref.updateMetadata(metadata) { result in
490482
self.assertResultSuccess(result)

FirebaseStorageInternal/Sources/FIRStorageConstants.m

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
NSString *const kFIRStorageMetadataContentEncoding = @"contentEncoding";
6565
NSString *const kFIRStorageMetadataContentLanguage = @"contentLanguage";
6666
NSString *const kFIRStorageMetadataContentType = @"contentType";
67-
NSString *const kFIRStorageMetadataCustomTime = @"customTime";
6867
NSString *const kFIRStorageMetadataCustomMetadata = @"metadata";
6968
NSString *const kFIRStorageMetadataSize = @"size";
7069
NSString *const kFIRStorageMetadataGeneration = @"generation";

FirebaseStorageInternal/Sources/FIRStorageConstants_Private.h

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ FOUNDATION_EXPORT NSString *const kFIRStorageMetadataContentDisposition;
5959
FOUNDATION_EXPORT NSString *const kFIRStorageMetadataContentEncoding;
6060
FOUNDATION_EXPORT NSString *const kFIRStorageMetadataContentLanguage;
6161
FOUNDATION_EXPORT NSString *const kFIRStorageMetadataContentType;
62-
FOUNDATION_EXPORT NSString *const kFIRStorageMetadataCustomTime;
6362
FOUNDATION_EXPORT NSString *const kFIRStorageMetadataCustomMetadata;
6463
FOUNDATION_EXPORT NSString *const kFIRStorageMetadataSize;
6564
FOUNDATION_EXPORT NSString *const kFIRStorageMetadataGeneration;

FirebaseStorageInternal/Sources/FIRStorageMetadata.m

-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ - (instancetype)initWithDictionary:(NSDictionary *)dictionary {
4040
_contentEncoding = dictionary[kFIRStorageMetadataContentEncoding];
4141
_contentLanguage = dictionary[kFIRStorageMetadataContentLanguage];
4242
_contentType = dictionary[kFIRStorageMetadataContentType];
43-
_customTime = [self dateFromRFC3339String:dictionary[kFIRStorageMetadataCustomTime]];
4443
_customMetadata = dictionary[kFIRStorageMetadataCustomMetadata];
4544
_size = [dictionary[kFIRStorageMetadataSize] longLongValue];
4645
_generation = [dictionary[kFIRStorageMetadataGeneration] longLongValue];
@@ -120,10 +119,6 @@ - (NSDictionary *)dictionaryRepresentation {
120119
metadataDictionary[kFIRStorageMetadataContentType] = _contentType;
121120
}
122121

123-
if (_customTime) {
124-
metadataDictionary[kFIRStorageMetadataCustomTime] = [self RFC3339StringFromDate:_customTime];
125-
}
126-
127122
if (_md5Hash) {
128123
metadataDictionary[kFIRStorageMetadataMd5Hash] = _md5Hash;
129124
}

FirebaseStorageInternal/Sources/Public/FirebaseStorageInternal/FIRStorageMetadata.h

-5
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ NS_ASSUME_NONNULL_BEGIN
5959
*/
6060
@property(copy, nonatomic, nullable) NSString *contentType;
6161

62-
/**
63-
* Custom-Time of the object data.
64-
*/
65-
@property(copy, nonatomic, nullable) NSDate *customTime;
66-
6762
/**
6863
* MD5 hash of the data; encoded using base64.
6964
*/

FirebaseStorageInternal/Tests/Integration/FIRStorageIntegrationTests.m

-8
Original file line numberDiff line numberDiff line change
@@ -580,14 +580,12 @@ - (void)testCancelDownload {
580580

581581
- (void)assertMetadata:(FIRStorageMetadata *)actualMetadata
582582
contentType:(NSString *)expectedContentType
583-
customTime:(NSDate *)expectedCustomTime
584583
customMetadata:(NSDictionary *)expectedCustomMetadata {
585584
XCTAssertEqualObjects(actualMetadata.cacheControl, @"cache-control");
586585
XCTAssertEqualObjects(actualMetadata.contentDisposition, @"content-disposition");
587586
XCTAssertEqualObjects(actualMetadata.contentEncoding, @"gzip");
588587
XCTAssertEqualObjects(actualMetadata.contentLanguage, @"de");
589588
XCTAssertEqualObjects(actualMetadata.contentType, expectedContentType);
590-
XCTAssertEqualObjects(actualMetadata.customTime, expectedCustomTime);
591589
XCTAssertTrue([actualMetadata.md5Hash length] == 24);
592590
for (NSString *key in expectedCustomMetadata) {
593591
XCTAssertEqualObjects([actualMetadata.customMetadata objectForKey:key],
@@ -601,7 +599,6 @@ - (void)assertMetadataNil:(FIRStorageMetadata *)actualMetadata {
601599
XCTAssertEqualObjects(actualMetadata.contentEncoding, @"identity");
602600
XCTAssertNil(actualMetadata.contentLanguage);
603601
XCTAssertNil(actualMetadata.contentType);
604-
XCTAssertNil(actualMetadata.customTime);
605602
XCTAssertTrue([actualMetadata.md5Hash length] == 24);
606603
XCTAssertNil(actualMetadata.customMetadata);
607604
}
@@ -618,29 +615,25 @@ - (void)testUpdateMetadata {
618615
metadata.contentEncoding = @"gzip";
619616
metadata.contentLanguage = @"de";
620617
metadata.contentType = @"content-type-a";
621-
metadata.customTime = [NSDate dateWithTimeIntervalSince1970:0];
622618
metadata.customMetadata = @{@"a" : @"b"};
623619

624620
[ref updateMetadata:metadata
625621
completion:^(FIRStorageMetadata *updatedMetadata, NSError *error) {
626622
XCTAssertNil(error);
627623
[self assertMetadata:updatedMetadata
628624
contentType:@"content-type-a"
629-
customTime:[NSDate dateWithTimeIntervalSince1970:0]
630625
customMetadata:@{@"a" : @"b"}];
631626

632627
// Update a subset of the metadata using the existing object.
633628
FIRStorageMetadata *metadata = updatedMetadata;
634629
metadata.contentType = @"content-type-b";
635-
metadata.customTime = [NSDate dateWithTimeIntervalSince1970:100];
636630
metadata.customMetadata = @{@"a" : @"b", @"c" : @"d"};
637631

638632
[ref updateMetadata:metadata
639633
completion:^(FIRStorageMetadata *updatedMetadata, NSError *error) {
640634
XCTAssertNil(error);
641635
[self assertMetadata:updatedMetadata
642636
contentType:@"content-type-b"
643-
customTime:[NSDate dateWithTimeIntervalSince1970:100]
644637
customMetadata:@{@"a" : @"b", @"c" : @"d"}];
645638

646639
// Clear all metadata.
@@ -650,7 +643,6 @@ - (void)testUpdateMetadata {
650643
metadata.contentEncoding = nil;
651644
metadata.contentLanguage = nil;
652645
metadata.contentType = nil;
653-
metadata.customTime = nil;
654646
metadata.customMetadata = [NSDictionary dictionary];
655647

656648
[ref updateMetadata:metadata

FirebaseStorageInternal/Tests/Unit/FIRStorageMetadataTests.m

-6
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ - (void)testInitializeFullMetadata {
4242
kFIRStorageMetadataContentEncoding : @"gzip",
4343
kFIRStorageMetadataContentLanguage : @"en-us",
4444
kFIRStorageMetadataContentType : @"application/octet-stream",
45-
kFIRStorageMetadataCustomTime : @"2016-03-01T20:16:01.673Z",
4645
kFIRStorageMetadataCustomMetadata : @{@"foo" : @{@"bar" : @"baz"}},
4746
kFIRStorageMetadataGeneration : @"12345",
4847
kFIRStorageMetadataMetageneration : @"67890",
@@ -60,8 +59,6 @@ - (void)testInitializeFullMetadata {
6059
metaDict[kFIRStorageMetadataContentDisposition]);
6160
XCTAssertEqualObjects(metadata.contentEncoding, metaDict[kFIRStorageMetadataContentEncoding], );
6261
XCTAssertEqualObjects(metadata.contentType, metaDict[kFIRStorageMetadataContentType]);
63-
XCTAssertEqualObjects([metadata RFC3339StringFromDate:metadata.customTime],
64-
metaDict[kFIRStorageMetadataCustomTime]);
6562
XCTAssertEqualObjects(metadata.customMetadata, metaDict[kFIRStorageMetadataCustomMetadata]);
6663
XCTAssertEqualObjects(metadata.md5Hash, metaDict[kFIRStorageMetadataMd5Hash]);
6764
NSString *generation = [NSString stringWithFormat:@"%lld", metadata.generation];
@@ -85,7 +82,6 @@ - (void)testDictionaryRepresentation {
8582
kFIRStorageMetadataContentEncoding : @"gzip",
8683
kFIRStorageMetadataContentLanguage : @"en-us",
8784
kFIRStorageMetadataContentType : @"application/octet-stream",
88-
kFIRStorageMetadataCustomTime : @"2016-03-01T20:16:01.673Z",
8985
kFIRStorageMetadataCustomMetadata : @{@"foo" : @{@"bar" : @"baz"}},
9086
kFIRStorageMetadataGeneration : @"12345",
9187
kFIRStorageMetadataMetageneration : @"67890",
@@ -110,8 +106,6 @@ - (void)testDictionaryRepresentation {
110106
metaDict[kFIRStorageMetadataContentLanguage]);
111107
XCTAssertEqualObjects(dictRepresentation[kFIRStorageMetadataContentType],
112108
metaDict[kFIRStorageMetadataContentType]);
113-
XCTAssertEqualObjects(dictRepresentation[kFIRStorageMetadataCustomTime],
114-
metaDict[kFIRStorageMetadataCustomTime]);
115109
XCTAssertEqualObjects(dictRepresentation[kFIRStorageMetadataCustomMetadata],
116110
metaDict[kFIRStorageMetadataCustomMetadata]);
117111
XCTAssertEqualObjects(dictRepresentation[kFIRStorageMetadataDownloadTokens],

0 commit comments

Comments
 (0)