Skip to content

Commit e41f4b1

Browse files
authored
Merge Release 4.10.1 into Master (#896)
* Version bumps for Firebase 4.10.1 (#891) * Minimal fix for b/74357976 (#890) Fixes b/74357976 which caused unauthenticated users to be unable to reach the Firestore backend and updates the changelog. * Copy all C++ strings to NSString where they're not obviously safe (#893) This fixes a known instances of memory corruption where in FSTLevelDBMutationQueue, the NSString view was retained for later, and the incorrect user was used, causing b/74381054. gRPC does not necessarily copy its string argumnets and if our hostname were configured to a non-default one it's possible that we could corrupt the host cache too. All remaining usages of util::WrapNSStringNoCopy are obviously safe: passed into logging or other known transient usages. * fix lint
1 parent 2ae36f1 commit e41f4b1

File tree

10 files changed

+25
-16
lines changed

10 files changed

+25
-16
lines changed

Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ target 'Core_Example_iOS' do
88
# The next line is the forcing function for the Firebase pod. The Firebase
99
# version's subspecs should depend on the component versions in their
1010
# corresponding podspec's.
11-
pod 'Firebase/Core', '4.10.0'
11+
pod 'Firebase/Core', '4.10.1'
1212

1313
target 'Core_Tests_iOS' do
1414
inherit! :search_paths

Firebase/Core/FIROptions.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
NSString *const kFIRLibraryVersionID =
4444
@"4" // Major version (one or more digits)
4545
@"00" // Minor version (exactly 2 digits)
46-
@"16" // Build number (exactly 2 digits)
46+
@"17" // Build number (exactly 2 digits)
4747
@"000"; // Fixed "000"
4848
// Plist file name.
4949
NSString *const kServiceInfoFileName = @"GoogleService-Info";

FirebaseCore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseCore'
3-
s.version = '4.0.16'
3+
s.version = '4.0.17'
44
s.summary = 'Firebase Core for iOS'
55

66
s.description = <<-DESC

FirebaseFirestore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'FirebaseFirestore'
11-
s.version = '0.10.2'
11+
s.version = '0.10.3'
1212
s.summary = 'Google Cloud Firestore for iOS'
1313

1414
s.description = <<-DESC

Firestore/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
"offline", causing getDocument() calls to resolve with cached results, rather
55
than continuing to wait.
66

7+
# v0.10.3
8+
- [fixed] Fixed a regression in the 4.10.0 Firebase iOS SDK release that
9+
prevented the SDK from communicating with the backend before successfully
10+
authenticating via Firebase Authentication or after unauthenticating and
11+
re-authenticating. Reads and writes would silently be executed locally
12+
but not sent to the backend.
13+
714
# v0.10.2
815
- [changed] When you delete a FirebaseApp, the associated Firestore instances
916
are now also deleted (#683).

Firestore/Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The next line is the forcing function for the Firebase pod. The Firebase
22
# version's subspecs should depend on the component versions in their
33
# corresponding podspec's.
4-
pod 'Firebase/Core', '4.10.0'
4+
pod 'Firebase/Core', '4.10.1'
55

66
use_frameworks!
77
platform :ios, '8.0'

Firestore/Source/Local/FSTLevelDBMutationQueue.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ @implementation FSTLevelDBMutationQueue {
9494
+ (instancetype)mutationQueueWithUser:(const User &)user
9595
db:(std::shared_ptr<DB>)db
9696
serializer:(FSTLocalSerializer *)serializer {
97-
NSString *userID = user.is_authenticated() ? util::WrapNSStringNoCopy(user.uid()) : @"";
97+
NSString *userID = user.is_authenticated() ? util::WrapNSString(user.uid()) : @"";
9898

9999
return [[FSTLevelDBMutationQueue alloc] initWithUserID:userID db:db serializer:serializer];
100100
}
@@ -103,7 +103,7 @@ - (instancetype)initWithUserID:(NSString *)userID
103103
db:(std::shared_ptr<DB>)db
104104
serializer:(FSTLocalSerializer *)serializer {
105105
if (self = [super init]) {
106-
_userID = userID;
106+
_userID = [userID copy];
107107
_db = db;
108108
_serializer = serializer;
109109
}

Firestore/Source/Remote/FSTDatastore.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ - (instancetype)initWithDatabaseInfo:(const DatabaseInfo *)databaseInfo
9797
credentials:(CredentialsProvider *)credentials {
9898
if (self = [super init]) {
9999
_databaseInfo = databaseInfo;
100-
NSString *host = util::WrapNSStringNoCopy(databaseInfo->host());
100+
NSString *host = util::WrapNSString(databaseInfo->host());
101101
if (!databaseInfo->ssl_enabled()) {
102102
GRPCHost *hostConfig = [GRPCHost hostWithAddress:host];
103103
hostConfig.secure = NO;
@@ -319,7 +319,8 @@ - (void)invokeRPCWithFactory:(GRPCProtoCall * (^)(void))rpcFactory
319319
[FSTDatastore
320320
prepareHeadersForRPC:rpc
321321
databaseID:&self.databaseInfo->database_id()
322-
token:(result.is_valid() ? result.token() : absl::string_view())];
322+
token:(result.user().is_authenticated() ? result.token()
323+
: absl::string_view())];
323324
[rpc start];
324325
}
325326
}];

Firestore/Source/Remote/FSTSerializerBeta.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ - (FSTResourcePath *)decodedQueryPath:(NSString *)name {
152152

153153
- (FSTResourcePath *)encodedResourcePathForDatabaseID:(const DatabaseId *)databaseID {
154154
return [FSTResourcePath pathWithSegments:@[
155-
@"projects", util::WrapNSStringNoCopy(databaseID->project_id()), @"databases",
156-
util::WrapNSStringNoCopy(databaseID->database_id())
155+
@"projects", util::WrapNSString(databaseID->project_id()), @"databases",
156+
util::WrapNSString(databaseID->database_id())
157157
]];
158158
}
159159

Firestore/Source/Remote/FSTStream.mm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,10 @@ - (void)resumeStartWithToken:(const Token &)token error:(NSError *)error {
297297
_rpc = [self createRPCWithRequestsWriter:self.requestsWriter];
298298
[_rpc setResponseDispatchQueue:self.workerDispatchQueue.queue];
299299

300-
[FSTDatastore prepareHeadersForRPC:_rpc
301-
databaseID:&self.databaseInfo->database_id()
302-
token:(token.is_valid() ? token.token() : absl::string_view())];
300+
[FSTDatastore
301+
prepareHeadersForRPC:_rpc
302+
databaseID:&self.databaseInfo->database_id()
303+
token:(token.user().is_authenticated() ? token.token() : absl::string_view())];
303304
FSTAssert(_callbackFilter == nil, @"GRX Filter must be nil");
304305
_callbackFilter = [[FSTCallbackFilter alloc] initWithStream:self];
305306
[_rpc startWithWriteable:_callbackFilter];
@@ -631,7 +632,7 @@ - (instancetype)initWithDatabase:(const DatabaseInfo *)database
631632
}
632633

633634
- (GRPCCall *)createRPCWithRequestsWriter:(GRXWriter *)requestsWriter {
634-
return [[GRPCCall alloc] initWithHost:util::WrapNSStringNoCopy(self.databaseInfo->host())
635+
return [[GRPCCall alloc] initWithHost:util::WrapNSString(self.databaseInfo->host())
635636
path:@"/google.firestore.v1beta1.Firestore/Listen"
636637
requestsWriter:requestsWriter];
637638
}
@@ -716,7 +717,7 @@ - (instancetype)initWithDatabase:(const DatabaseInfo *)database
716717
}
717718

718719
- (GRPCCall *)createRPCWithRequestsWriter:(GRXWriter *)requestsWriter {
719-
return [[GRPCCall alloc] initWithHost:util::WrapNSStringNoCopy(self.databaseInfo->host())
720+
return [[GRPCCall alloc] initWithHost:util::WrapNSString(self.databaseInfo->host())
720721
path:@"/google.firestore.v1beta1.Firestore/Write"
721722
requestsWriter:requestsWriter];
722723
}

0 commit comments

Comments
 (0)