-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Do not continue with fetch if we do not get a valid IID. #4745
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
Conversation
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.
Mostly LGTM. Couple minor comments for tests from me.
_checkCompletionTimeout = 1.0; | ||
|
||
// Always remove the database at the start of testing. | ||
_DBPath = [RCNTestUtilities remoteConfigPathForTestDatabase]; |
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.
nit: I would prefer having separate helper methods for the setup operations as it looks more readable to me. Maybe even move some into RCNTestUtilities
?
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.
will raincheck on this one. Some of the setup is particular to this file and will need to spend some time for a good generic option to pull this into RCNTestUtilities.
// Always remove the database at the start of testing. | ||
_DBPath = [RCNTestUtilities remoteConfigPathForTestDatabase]; | ||
id classMock = OCMClassMock([RCNConfigDBManager class]); | ||
OCMStub([classMock remoteConfigPathForDatabase]).andReturn(_DBPath); |
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.
Do we need to stop mocking the class at the end of the test to avoid interference with other tests? If so classMock
should be stored to an ivar and taken care in tearDown
method.
The same for similar mocks below.
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.
Done.
.andReturn(_userDefaults); | ||
|
||
RCNConfigContent *configContent = [[RCNConfigContent alloc] initWithDBManager:_DBManager]; | ||
_configInstances = [[NSMutableArray alloc] initWithCapacity:3]; |
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.
nit: use RCNTestRCNumTotalInstances
instead of 3
?
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.
Done.
// Test for each RC FIRApp, namespace instance. | ||
for (int i = 0; i < RCNTestRCNumTotalInstances; i++) { | ||
// Set the token as nil. | ||
[self mockInstanceIDMethodForTokenAndIdentity:nil |
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.
looks like it should be out of the loop.
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.
Done.
XCTAssertNil(error); | ||
}]; | ||
} | ||
|
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.
Maybe add a test for a success case?
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.
This should be addressed in the other tests.
@@ -1396,7 +1396,9 @@ - (void)testSetFetchTimeoutConfigSetting { | |||
- (void)testConfigureConfigWithValidInput { | |||
// Configure the default app with our options and ensure the Remote Config instance is set up | |||
// properly. | |||
XCTAssertNoThrow([FIRApp configureWithOptions:[self firstAppOptions]]); | |||
if (![FIRApp isDefaultAppConfigured]) { |
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.
Why the default app may be configured here? It looks cleaner to me to make sure previous tests clean up the state in tearDown
and assert this condition in the tests or setUp
, so the check below is performed unconditionally.
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.
The IID SDK's init needs a default app configured. How do i reset FIRApp state in teardown?
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.
I think [FIRApp deleteApp:] or probably better [FIRApp resetApps] should do the trick.
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.
Nice! done.
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.
Please fix unit tests
Since code freeze is tomorrow and RC is a dependent pod, please try to resolve the open issues and merge today. |
Still seeing an Xcode 11 build warning:
|
Hi! im coming here from #4622 |
Fixes #4622