File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Example/Tests/Integration/API Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
# 10.11.0
2
2
- [ feature] Expose MultiDb API for public preview. (#10465 )
3
3
- [ fixed] Fixed a compilation warning related to integer casting. (#11332 )
4
+ - [ fixed] Allow initializing FIRLocalCacheSettings with unlimited size. (#11405 )
4
5
5
6
# 10.9.0
6
7
- [ feature] Add new cache config API to customize SDK cache settings.
Original file line number Diff line number Diff line change 28
28
#import " Firestore/Source/API/FIRLocalCacheSettings+Internal.h"
29
29
30
30
#include " Firestore/core/src/api/query_snapshot.h"
31
+ #include " Firestore/core/src/api/settings.h"
31
32
#include " Firestore/core/src/core/firestore_client.h"
32
33
#include " Firestore/core/src/model/database_id.h"
33
34
#include " Firestore/core/src/util/string_apple.h"
34
35
#include " Firestore/core/test/unit/testutil/app_testing.h"
35
36
37
+ using api::Settings;
36
38
using firebase::firestore::model::DatabaseId;
37
39
using firebase::firestore::testutil::AppForUnitTesting;
38
40
using firebase::firestore::util::MakeNSString;
@@ -1813,4 +1815,18 @@ - (void)testMinimumCacheSize {
1813
1815
NSException );
1814
1816
}
1815
1817
1818
+ - (void )testUnlimitedCacheSize {
1819
+ FIRPersistentCacheSettings *cacheSettings =
1820
+ [[FIRPersistentCacheSettings alloc ] initWithSizeBytes: @(Settings: :CacheSizeUnlimited)];
1821
+ XCTAssertEqual (cacheSettings.internalSettings .size_bytes (), Settings::CacheSizeUnlimited);
1822
+
1823
+ self.db .settings .cacheSettings = cacheSettings;
1824
+
1825
+ FIRDocumentReference *doc = [self .db documentWithPath: @" rooms/eros" ];
1826
+ NSDictionary <NSString *, id > *data = @{@" value" : @" foo" };
1827
+ [self writeDocumentRef: doc data: data];
1828
+ FIRDocumentSnapshot *result = [self readDocumentForRef: doc];
1829
+ XCTAssertEqualObjects (result.data , data);
1830
+ }
1831
+
1816
1832
@end
Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ - (instancetype)init {
73
73
74
74
- (instancetype )initWithSizeBytes : (NSNumber *)size {
75
75
self = [super init ];
76
- if (size.longLongValue < Settings::MinimumCacheSizeBytes) {
76
+ if (size.longLongValue != Settings::CacheSizeUnlimited &&
77
+ size.longLongValue < Settings::MinimumCacheSizeBytes) {
77
78
ThrowInvalidArgument (" Cache size must be set to at least %s bytes" ,
78
79
Settings::MinimumCacheSizeBytes);
79
80
}
You can’t perform that action at this time.
0 commit comments