Skip to content

Commit 849c138

Browse files
committed
ci fixes
1 parent 991f9c9 commit 849c138

File tree

3 files changed

+21
-57
lines changed

3 files changed

+21
-57
lines changed

FirebaseRemoteConfig/Sources/Private/RCNConfigSettings.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@class RCNConfigDBManager;
2222

2323
/// This internal class contains a set of variables that are unique among all the config instances.
24-
/// It also handles all metadata and internal metadata. This class is not thread safe and does not
24+
/// It also handles all metadata. This class is not thread safe and does not
2525
/// inherently allow for synchronized access. Callers are responsible for synchronization
2626
/// (currently using serial dispatch queues).
2727
@interface RCNConfigSettings : NSObject
@@ -55,11 +55,6 @@
5555
/// Custom variable (aka App context digest). This is the pending custom variables request before
5656
/// fetching.
5757
@property(nonatomic, copy) NSDictionary *customVariables;
58-
/// Cached internal metadata from internal metadata table. It contains customized information such
59-
/// as HTTP connection timeout, HTTP read timeout, success/failure throttling rate and time
60-
/// interval. Client has the default value of each parameters, they are only saved in
61-
/// internalMetadata if they have been customize by developers.
62-
@property(nonatomic, readonly, copy) NSDictionary *internalMetadata;
6358
/// Device conditions since last successful fetch from the backend. Device conditions including
6459
/// app
6560
/// version, iOS version, device localte, language, GMP project ID and Game project ID. Used for
@@ -128,9 +123,6 @@
128123
/// Returns metadata from metadata table.
129124
- (void)loadConfigFromMetadataTable;
130125

131-
/// Updates internal content with the latest successful config response.
132-
- (void)updateInternalContentWithResponse:(NSDictionary *)response;
133-
134126
/// Updates the metadata table with the current fetch status.
135127
/// @param fetchSuccess True if fetch was successful.
136128
- (void)updateMetadataWithFetchSuccessStatus:(BOOL)fetchSuccess

FirebaseRemoteConfig/Sources/RCNConfigSettings.m

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -213,31 +213,6 @@ - (void)loadConfigFromMetadataTable {
213213

214214
#pragma mark - update DB/cached
215215

216-
// Update internal metadata content to cache and DB.
217-
- (void)updateInternalContentWithResponse:(NSDictionary *)response {
218-
// Remove all the keys with current package name.
219-
[_DBManager deleteRecordWithBundleIdentifier:_bundleIdentifier
220-
namespace:_FIRNamespace
221-
isInternalDB:YES];
222-
223-
for (NSString *key in _internalMetadata.allKeys) {
224-
if ([key hasPrefix:_bundleIdentifier]) {
225-
[_internalMetadata removeObjectForKey:key];
226-
}
227-
}
228-
229-
for (NSString *entry in response) {
230-
NSData *val = [response[entry] dataUsingEncoding:NSUTF8StringEncoding];
231-
NSArray *values = @[ entry, val ];
232-
_internalMetadata[entry] = response[entry];
233-
[self updateInternalMetadataTableWithValues:values];
234-
}
235-
}
236-
237-
- (void)updateInternalMetadataTableWithValues:(NSArray *)values {
238-
[_DBManager insertInternalMetadataTableWithValues:values completionHandler:nil];
239-
}
240-
241216
/// If the last fetch was not successful, update the (exponential backoff) period that we wait until
242217
/// fetching again. Any subsequent fetch requests will be checked and allowed only if past this
243218
/// throttle end time.
@@ -338,9 +313,7 @@ - (void)updateFetchTimeWithSuccessFetch:(BOOL)isSuccessfulFetch {
338313
}
339314

340315
- (void)updateMetadataTable {
341-
[_DBManager deleteRecordWithBundleIdentifier:_bundleIdentifier
342-
namespace:_FIRNamespace
343-
isInternalDB:NO];
316+
[_DBManager deleteRecordWithBundleIdentifier:_bundleIdentifier namespace:_FIRNamespace];
344317
NSError *error;
345318
// Objects to be serialized cannot be invalid.
346319
if (!_bundleIdentifier) {

FirebaseRemoteConfig/SwiftNew/ConfigDBManager.swift

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -313,40 +313,39 @@ open class ConfigDBManager: NSObject {
313313
bundleIdentifier: String,
314314
fromSource source: DBSource) {
315315
let params = [bundleIdentifier, namespace]
316-
var sql = "DELETE FROM main WHERE bundle_identifier = ? and namespace = ?"
317-
if source == .default {
318-
sql = "DELETE FROM main_default WHERE bundle_identifier = ? and namespace = ?"
319-
} else if source == .active {
320-
sql = "DELETE FROM main_active WHERE bundle_identifier = ? and namespace = ?"
321-
}
316+
let sql =
317+
if source == .default {
318+
"DELETE FROM main_default WHERE bundle_identifier = ? and namespace = ?"
319+
} else if source == .active {
320+
"DELETE FROM main_active WHERE bundle_identifier = ? and namespace = ?"
321+
} else {
322+
"DELETE FROM main WHERE bundle_identifier = ? and namespace = ?"
323+
}
322324
Task {
323325
await self.databaseActor.executeQuery(sql, withParams: params)
324326
}
325327
}
326328

327329
@objc public
328330
func deleteRecord(withBundleIdentifier bundleIdentifier: String,
329-
namespace: String,
330-
isInternalDB: Bool) {
331-
var sql = "DELETE FROM internal_metadata WHERE key LIKE ?"
332-
var params = [bundleIdentifier]
333-
if !isInternalDB {
334-
sql = "DELETE FROM fetch_metadata WHERE bundle_identifier = ? and namespace = ?"
335-
params = [bundleIdentifier, namespace]
336-
}
331+
namespace: String) {
332+
let sql = "DELETE FROM fetch_metadata WHERE bundle_identifier = ? and namespace = ?"
333+
let params = [bundleIdentifier, namespace]
337334
Task {
338335
await self.databaseActor.executeQuery(sql, withParams: params)
339336
}
340337
}
341338

342339
@objc public
343340
func deleteAllRecords(fromTableWithSource source: DBSource) {
344-
var sql = "DELETE FROM main"
345-
if source == .default {
346-
sql = "DELETE FROM main_default"
347-
} else if source == .active {
348-
sql = "DELETE FROM main_active"
349-
}
341+
let sql =
342+
if source == .default {
343+
"DELETE FROM main_default"
344+
} else if source == .active {
345+
"DELETE FROM main_active"
346+
} else {
347+
"DELETE FROM main"
348+
}
350349
Task {
351350
await self.databaseActor.executeQuery(sql)
352351
}

0 commit comments

Comments
 (0)