Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,19 @@ - (void)writeInitialData {

/** Waits for a snapshot with local writes. */
- (FIRDocumentSnapshot *)waitForLocalEvent {
FIRDocumentSnapshot *snapshot = [_accumulator awaitEventWithName:@"Local event."];
XCTAssertTrue(snapshot.metadata.hasPendingWrites);
FIRDocumentSnapshot *snapshot;
do {
snapshot = [_accumulator awaitEventWithName:@"Local event."];
} while (!snapshot.metadata.hasPendingWrites);
return snapshot;
}

/** Waits for a snapshot that has no pending writes */
- (FIRDocumentSnapshot *)waitForRemoteEvent {
FIRDocumentSnapshot *snapshot = [_accumulator awaitEventWithName:@"Remote event."];
XCTAssertFalse(snapshot.metadata.hasPendingWrites);
FIRDocumentSnapshot *snapshot;
do {
snapshot = [_accumulator awaitEventWithName:@"Remote event."];
} while (snapshot.metadata.hasPendingWrites);
return snapshot;
}

Expand Down
3 changes: 1 addition & 2 deletions Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ - (void)testEncodesNestedObjects {
@"i" : @1,
@"n" : [NSNull null],
@"s" : @"foo",
@"a" : @[ @2, @"bar",
@{ @"b" : @NO } ],
@"a" : @[ @2, @"bar", @{@"b" : @NO} ],
@"o" : @{
@"d" : @100,
@"nested" : @{@"e" : @(LLONG_MIN)},
Expand Down
16 changes: 8 additions & 8 deletions Firestore/Source/API/FIRFirestore.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ - (instancetype)initWithProjectID:(NSString *)projectID
}

- (FIRFirestoreSettings *)settings {
@synchronized (self) {
@synchronized(self) {
// Disallow mutation of our internal settings
return [_settings copy];
}
}

- (void)setSettings:(FIRFirestoreSettings *)settings {
@synchronized (self) {
@synchronized(self) {
// As a special exception, don't throw if the same settings are passed repeatedly. This should
// make it more friendly to create a Firestore instance.
if (_client && ![_settings isEqual:settings]) {
Expand All @@ -187,17 +187,17 @@ - (FSTFirestoreClient *)client {
}

- (void)ensureClientConfigured {
@synchronized (self) {
@synchronized(self) {
if (!_client) {
// These values are validated elsewhere; this is just double-checking:
FSTAssert(_settings.host, @"FirestoreSettings.host cannot be nil.");
FSTAssert(_settings.dispatchQueue, @"FirestoreSettings.dispatchQueue cannot be nil.");

FSTDatabaseInfo *databaseInfo =
[FSTDatabaseInfo databaseInfoWithDatabaseID:_databaseID
persistenceKey:_persistenceKey
host:_settings.host
sslEnabled:_settings.sslEnabled];
[FSTDatabaseInfo databaseInfoWithDatabaseID:_databaseID
persistenceKey:_persistenceKey
host:_settings.host
sslEnabled:_settings.sslEnabled];

FSTDispatchQueue *userDispatchQueue = [FSTDispatchQueue queueWith:_settings.dispatchQueue];

Expand Down Expand Up @@ -280,7 +280,7 @@ - (void)runTransactionWithBlock:(id _Nullable (^)(FIRTransaction *, NSError **er

- (void)shutdownWithCompletion:(nullable void (^)(NSError *_Nullable error))completion {
FSTFirestoreClient *client;
@synchronized (self) {
@synchronized(self) {
client = _client;
_client = nil;
}
Expand Down