-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset RC per-instance userdefaults if config database was not found. #4896
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,14 @@ - (instancetype)initWithDatabaseManager:(RCNConfigDBManager *)manager | |
_userDefaultsManager = [[RCNUserDefaultsManager alloc] initWithAppName:appName | ||
bundleID:_bundleIdentifier | ||
namespace:_FIRNamespace]; | ||
|
||
// Check if the config database is new. If so, clear the configs saved in userDefaults. | ||
if ([_DBManager isNewDatabase]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How can this test ever fail? I don't see gIsNewDatabase ever set to NO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test case setup method above creates a new test database. We just want to verify that this flag is set to true whenever an existing database is not found. |
||
FIRLogNotice(kFIRLoggerRemoteConfig, @"I-RCN000072", | ||
@"New config database created. Resetting user defaults."); | ||
[_userDefaultsManager resetUserDefaults]; | ||
} | ||
|
||
_isFetchInProgress = NO; | ||
} | ||
return self; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be made thread-safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is. The variable is used on the database serial queue.