Skip to content

Merging the 6.8.0 release into master #3783

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

Merged
merged 8 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,8 @@ jobs:
# need to make them fatal for the purposes of the test run.

# TODO(varconst): disallow sanitizers to fail once we fix all existing issues.
- env:
- PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=asan
- env:
- PROJECT=Firestore PLATFORM=macOS METHOD=cmake SANITIZERS=tsan
- env:
- PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=asan
- env:
- PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild SANITIZERS=tsan
- env:
Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ target 'Core_Example_iOS' do
# The next line is the forcing function for the Firebase pod. The Firebase
# version's subspecs should depend on the component versions in the
# corresponding podspec's in this repo.
pod 'Firebase/CoreOnly', '6.7.0'
pod 'Firebase/CoreOnly', '6.8.0'

target 'Core_Tests_iOS' do
inherit! :search_paths
Expand Down
37 changes: 31 additions & 6 deletions Firebase/Core/FIRComponentContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

NS_ASSUME_NONNULL_BEGIN

@interface FIRComponentContainer ()
@interface FIRComponentContainer () {
dispatch_queue_t _containerQueue;
}

/// The dictionary of components that are registered for a particular app. The key is an NSString
/// of the protocol.
Expand Down Expand Up @@ -67,6 +69,8 @@ - (instancetype)initWithApp:(FIRApp *)app registrants:(NSMutableSet<Class> *)all
_app = app;
_cachedInstances = [NSMutableDictionary<NSString *, id> dictionary];
_components = [NSMutableDictionary<NSString *, FIRComponentCreationBlock> dictionary];
_containerQueue =
dispatch_queue_create("com.google.FirebaseComponentContainer", DISPATCH_QUEUE_SERIAL);

[self populateComponentsFromRegisteredClasses:allRegistrants forApp:app];
}
Expand All @@ -92,7 +96,7 @@ - (void)populateComponentsFromRegisteredClasses:(NSSet<Class> *)classes forApp:(
// Store the creation block for later usage.
self.components[protocolName] = component.creationBlock;

// Instantiate the
// Instantiate the instance if it has requested to be instantiated.
BOOL shouldInstantiateEager =
(component.instantiationTiming == FIRInstantiationTimingAlwaysEager);
BOOL shouldInstantiateDefaultEager =
Expand Down Expand Up @@ -136,7 +140,9 @@ - (nullable id)instantiateInstanceForProtocol:(Protocol *)protocol

// The instance is ready to be returned, but check if it should be cached first before returning.
if (shouldCache) {
self.cachedInstances[protocolName] = instance;
dispatch_sync(_containerQueue, ^{
self.cachedInstances[protocolName] = instance;
});
}

return instance;
Expand All @@ -147,7 +153,11 @@ - (nullable id)instantiateInstanceForProtocol:(Protocol *)protocol
- (nullable id)instanceForProtocol:(Protocol *)protocol {
// Check if there is a cached instance, and return it if so.
NSString *protocolName = NSStringFromProtocol(protocol);
id cachedInstance = self.cachedInstances[protocolName];
__block id cachedInstance;
dispatch_sync(_containerQueue, ^{
cachedInstance = self.cachedInstances[protocolName];
});

if (cachedInstance) {
return cachedInstance;
}
Expand All @@ -161,14 +171,29 @@ - (nullable id)instanceForProtocol:(Protocol *)protocol {

- (void)removeAllCachedInstances {
// Loop through the cache and notify each instance that is a maintainer to clean up after itself.
for (id instance in self.cachedInstances.allValues) {
// Design note: we're getting a copy here, unlocking the cached instances, iterating over the
// copy, then locking and removing all cached instances. A race condition *could* exist where a
// new cached instance is created between the copy and the removal, but the chances are slim and
// side-effects are significantly smaller than including the entire loop in the `dispatch_sync`
// block (access to the cache from inside the block would deadlock and crash).
__block NSDictionary<NSString *, id> *instancesCopy;
dispatch_sync(_containerQueue, ^{
instancesCopy = [self.cachedInstances copy];
});

for (id instance in instancesCopy.allValues) {
if ([instance conformsToProtocol:@protocol(FIRComponentLifecycleMaintainer)] &&
[instance respondsToSelector:@selector(appWillBeDeleted:)]) {
[instance appWillBeDeleted:self.app];
}
}

[self.cachedInstances removeAllObjects];
instancesCopy = nil;

// Empty the cache.
dispatch_sync(_containerQueue, ^{
[self.cachedInstances removeAllObjects];
});
}

@end
Expand Down
3 changes: 3 additions & 0 deletions Firebase/DynamicLinks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v4.0.4
- [fixed] Removed references to UIWebView to comply with App Store Submission warning. (#3722)

# v4.0.3
- [added] Added support for custom domains for internal Google apps. (#3540)

Expand Down
48 changes: 5 additions & 43 deletions Firebase/DynamicLinks/FIRDLJavaScriptExecutor.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ @implementation FIRDLJavaScriptExecutor {
__weak id<FIRDLJavaScriptExecutorDelegate> _delegate;
NSString *_script;

// Web views with which to run JavaScript.
UIWebView *_uiWebView; // Used in iOS 7 only.
WKWebView *_wkWebView; // Used in iOS 8+ only.
// Web view with which to run JavaScript.
WKWebView *_wkWebView;
}

- (instancetype)initWithDelegate:(id<FIRDLJavaScriptExecutorDelegate>)delegate
Expand All @@ -82,17 +81,9 @@ - (void)start {
NSString *htmlContent =
[NSString stringWithFormat:@"<html><head><script>%@</script></head></html>", _script];

// Use WKWebView if available as it executes JavaScript more quickly, otherwise, fall back
// on UIWebView.
if ([WKWebView class]) {
_wkWebView = [[WKWebView alloc] init];
_wkWebView.navigationDelegate = self;
[_wkWebView loadHTMLString:htmlContent baseURL:nil];
} else {
_uiWebView = [[UIWebView alloc] init];
_uiWebView.delegate = self;
[_uiWebView loadHTMLString:htmlContent baseURL:nil];
}
_wkWebView = [[WKWebView alloc] init];
_wkWebView.navigationDelegate = self;
[_wkWebView loadHTMLString:htmlContent baseURL:nil];
}

- (void)handleExecutionResult:(NSString *)result {
Expand All @@ -109,8 +100,6 @@ - (void)handleExecutionError:(nullable NSError *)error {
}

- (void)cleanup {
_uiWebView.delegate = nil;
_uiWebView = nil;
_wkWebView.navigationDelegate = nil;
_wkWebView = nil;
}
Expand Down Expand Up @@ -150,33 +139,6 @@ - (void)webView:(WKWebView *)webView
[self handleExecutionError:error];
}

#pragma mark - UIWebViewDelegate

- (void)webViewDidFinishLoad:(UIWebView *)webView {
// Make sure that the javascript was loaded successfully before calling the method.
NSString *methodType =
[webView stringByEvaluatingJavaScriptFromString:FIRDLTypeofFingerprintJSMethodNameString()];
if (![methodType isEqualToString:@"function"]) {
// Javascript was not loaded successfully.
[self handleExecutionError:nil];
return;
}

// Get the result from javascript.
NSString *result =
[webView stringByEvaluatingJavaScriptFromString:GINFingerprintJSMethodString()];
if ([result isKindOfClass:[NSString class]]) {
[self handleExecutionResult:result];
} else {
[self handleExecutionError:nil];
}
}

- (void)webView:(UIWebView *)webView
didFailLoadWithError:(FIRDL_NULLABLE_IOS9_NONNULLABLE_IOS10 NSError *)error {
[self handleExecutionError:error];
}

@end

NS_ASSUME_NONNULL_END
5 changes: 3 additions & 2 deletions FirebaseABTesting.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseABTesting'
s.version = '3.1.0'
s.version = '3.1.1'
s.summary = 'Firebase ABTesting for iOS'

s.description = <<-DESC
Expand Down Expand Up @@ -31,7 +31,8 @@ Firebase Cloud Messaging and Firebase Remote Config in your app.
base_dir = "FirebaseABTesting/Sources/"
s.source_files = base_dir + '**/*.[mh]'
s.requires_arc = base_dir + '*.m'
s.public_header_files = base_dir + 'Public/*.h'
s.public_header_files = base_dir + 'Public/*.h', base_dir + 'Protos/developers/mobile/abt/proto/*.h'
s.private_header_files = base_dir + 'Protos/developers/mobile/abt/proto/*.h'
s.pod_target_xcconfig = {
'GCC_C_LANGUAGE_STANDARD' => 'c99',
'GCC_PREPROCESSOR_DEFINITIONS' =>
Expand Down
2 changes: 1 addition & 1 deletion FirebaseABTesting/Sources/FIRExperimentController.m
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ - (void)updateExperimentsWithServiceOrigin:(NSString *)origin

- (NSTimeInterval)latestExperimentStartTimestampBetweenTimestamp:(NSTimeInterval)timestamp
andPayloads:(NSArray<NSData *> *)payloads {
for (NSData *payload in payloads) {
for (NSData *payload in [payloads copy]) {
ABTExperimentPayload *experimentPayload = ABTDeserializeExperimentPayload(payload);
if (!experimentPayload) {
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000002",
Expand Down
4 changes: 2 additions & 2 deletions FirebaseCore.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseCore'
s.version = '6.2.1'
s.version = '6.2.2'
s.summary = 'Firebase Core for iOS (plus community support for macOS and tvOS)'

s.description = <<-DESC
Expand Down Expand Up @@ -39,7 +39,7 @@ Firebase Core includes FIRApp and FIROptions which provide central configuration
s.pod_target_xcconfig = {
'GCC_C_LANGUAGE_STANDARD' => 'c99',
'GCC_PREPROCESSOR_DEFINITIONS' =>
'FIRCore_VERSION=' + s.version.to_s + ' Firebase_VERSION=6.7.0',
'FIRCore_VERSION=' + s.version.to_s + ' Firebase_VERSION=6.8.0',
'OTHER_CFLAGS' => '-fno-autolink'
}
s.test_spec 'unit' do |unit_tests|
Expand Down
2 changes: 1 addition & 1 deletion FirebaseDynamicLinks.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseDynamicLinks'
s.version = '4.0.3'
s.version = '4.0.4'
s.summary = 'Firebase DynamicLinks for iOS'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion FirebaseFirestore.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseFirestore'
s.version = '1.4.5'
s.version = '1.5.0'
s.summary = 'Google Cloud Firestore for iOS'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion FirebaseInAppMessaging.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseInAppMessaging'
s.version = '0.15.3'
s.version = '0.15.4'
s.summary = 'Firebase In-App Messaging for iOS'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion FirebaseInstanceID.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseInstanceID'
s.version = '4.2.3'
s.version = '4.2.4'
s.summary = 'Firebase InstanceID for iOS'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion FirebaseMessaging.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FirebaseMessaging'
s.version = '4.1.3'
s.version = '4.1.4'
s.summary = 'Firebase Messaging for iOS'

s.description = <<-DESC
Expand Down
3 changes: 2 additions & 1 deletion FirebaseRemoteConfig.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ app update.
'FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m',
# 'FirebaseRemoteConfig/Tests/Unit/RCNThrottlingTests.m',
'FirebaseRemoteConfig/Tests/Unit/RCNTestUtilities.m',
'FirebaseRemoteConfig/Tests/Unit/RCNUserDefaultsManagerTests.m'
'FirebaseRemoteConfig/Tests/Unit/RCNUserDefaultsManagerTests.m',
'FirebaseRemoteConfig/Tests/Unit/RCNTestUtilities.h'
# Supply plist custom plist testing.
unit_tests.resources =
'FirebaseRemoteConfig/Tests/Unit/Defaults-testInfo.plist',
Expand Down
2 changes: 1 addition & 1 deletion FirebaseRemoteConfig/Sources/RCNConfigExperiment.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

#import "Protos/wireless/android/config/proto/Config.pbobjc.h"

#import <FirebaseABTesting/ExperimentPayload.pbobjc.h>
#import <FirebaseABTesting/FIRExperimentController.h>
#import <FirebaseABTesting/FIRLifecycleEvents.h>
#import <FirebaseCore/FIRLogger.h>
#import "FirebaseABTesting/Sources/Protos/developers/mobile/abt/proto/ExperimentPayload.pbobjc.h"
#import "FirebaseRemoteConfig/Sources/RCNConfigDBManager.h"
#import "FirebaseRemoteConfig/Sources/RCNConfigDefines.h"

Expand Down
2 changes: 1 addition & 1 deletion FirebaseRemoteConfig/Tests/Unit/RCNConfigExperimentTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
#import "FirebaseRemoteConfig/Sources/RCNConfigValue_Internal.h"
#import "FirebaseRemoteConfig/Tests/Unit/RCNTestUtilities.h"

#import <FirebaseABTesting/ExperimentPayload.pbobjc.h>
#import <FirebaseABTesting/FIRExperimentController.h>

#import <FirebaseAnalyticsInterop/FIRAnalyticsInterop.h>
#import <OCMock/OCMock.h>
#import "FirebaseABTesting/Sources/Protos/developers/mobile/abt/proto/ExperimentPayload.pbobjc.h"
#import "FirebaseRemoteConfig/Sources/Protos/wireless/android/config/proto/Config.pbobjc.h"

// Surface the internal FIRExperimentController initializer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
enableASanStackUseAfterReturn = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE03B2941F2149D600A30B9C"
BuildableName = "Firestore_IntegrationTests_iOS.xctest"
BlueprintName = "Firestore_IntegrationTests_iOS"
ReferencedContainer = "container:Firestore.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -39,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DE03B2941F2149D600A30B9C"
BuildableName = "Firestore_IntegrationTests_iOS.xctest"
BlueprintName = "Firestore_IntegrationTests_iOS"
ReferencedContainer = "container:Firestore.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -70,8 +69,6 @@
ReferencedContainer = "container:Firestore.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
2 changes: 1 addition & 1 deletion Firestore/Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ target 'Firestore_Example_iOS' do
# The next line is the forcing function for the Firebase pod. The Firebase
# version's subspecs should depend on the component versions in their
# corresponding podspecs.
pod 'Firebase/CoreOnly', '6.7.0'
pod 'Firebase/CoreOnly', '6.8.0'

configure_local_pods()

Expand Down
3 changes: 2 additions & 1 deletion Firestore/core/src/firebase/firestore/core/view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ ViewDocumentChanges View::ComputeDocumentChanges(
if (limit != Query::kNoLimit &&
new_document_set.size() > static_cast<size_t>(limit)) {
for (size_t i = new_document_set.size() - limit; i > 0; --i) {
const Document& old_doc = *new_document_set.GetLastDocument();
absl::optional<Document> found = new_document_set.GetLastDocument();
const Document& old_doc = *found;
new_document_set = new_document_set.erase(old_doc.key());
new_mutated_keys = new_mutated_keys.erase(old_doc.key());
change_set.AddChange(
Expand Down
2 changes: 1 addition & 1 deletion GoogleDataTransport.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'GoogleDataTransport'
s.version = '1.1.3'
s.version = '1.2.0'
s.summary = 'Google iOS SDK data transport.'

s.description = <<-DESC
Expand Down
3 changes: 3 additions & 0 deletions GoogleDataTransport/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v1.2.0
- Removes all NSAsserts in favor of custom asserts. (#3747)

# v1.1.3
- Wrap decoding in GDTUploadCoordinator in a try catch. (#3676)

Expand Down
Loading