Skip to content

Commit cad2840

Browse files
authored
fix(firestore, ios): fix an issue where unlimited cache wasn't properly set on iOS (#17412)
1 parent 64e8e34 commit cad2840

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTFirebaseFirestorePlugin.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,8 @@ - (FIRFirestore *_Nullable)getFIRFirestoreFromAppNameFromPigeon:
224224
if (pigeonApp.settings.persistenceEnabled != nil) {
225225
bool persistEnabled = [pigeonApp.settings.persistenceEnabled boolValue];
226226

227-
// This is the maximum amount of cache allowed. We use the same number on android.
228-
// This now causes an exception: kFIRFirestoreCacheSizeUnlimited
229-
NSNumber *size = @104857600;
227+
// We default to the maximum amount of cache allowed.
228+
NSNumber *size = @(kFIRFirestoreCacheSizeUnlimited);
230229

231230
if (pigeonApp.settings.cacheSizeBytes) {
232231
NSNumber *cacheSizeBytes = pigeonApp.settings.cacheSizeBytes;

packages/cloud_firestore/cloud_firestore/ios/cloud_firestore/Sources/cloud_firestore/FLTFirebaseFirestoreReader.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ - (FIRFirestoreSettings *)FIRFirestoreSettings {
104104
if (![values[@"persistenceEnabled"] isEqual:[NSNull null]]) {
105105
bool persistEnabled = [((NSNumber *)values[@"persistenceEnabled"]) boolValue];
106106

107-
// This is the maximum amount of cache allowed. We use the same number on android.
108-
// This now causes an exception: kFIRFirestoreCacheSizeUnlimited
109-
NSNumber *size = @104857600;
107+
// We default to the maximum amount of cache allowed.
108+
NSNumber *size = @(kFIRFirestoreCacheSizeUnlimited);
110109

111110
if (![values[@"cacheSizeBytes"] isEqual:[NSNull null]]) {
112111
NSNumber *cacheSizeBytes = ((NSNumber *)values[@"cacheSizeBytes"]);

0 commit comments

Comments
 (0)