Skip to content

Commit 2c58e9b

Browse files
wilhuffdconeybe
andauthored
Add #include for config.h to get the value for HAVE_LIBDISPATCH (#6041) (#6042)
Co-authored-by: Denver Coneybeare <[email protected]>
1 parent bc9c95b commit 2c58e9b

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Firestore/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Unreleased
22

3+
# v1.16.2
4+
- [fixed] Fixed a configuration issue where listeners were no longer being
5+
called back on the main thread by default.
6+
37
# v1.16.1
48
- [fixed] Removed a delay that may have prevented Firestore from immediately
59
establishing a network connection if a connectivity change occurred while

Firestore/Example/Tests/Integration/API/FIRDatabaseTests.mm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,15 @@ - (void)testListenerCallbackBlocksRemove {
14931493
// `ListenerRegistration::Remove()` and expect to be able to immediately delete that state. The
14941494
// trouble is that there may be a callback in progress against that listener so the implementation
14951495
// now blocks the remove call until the callback is complete.
1496+
//
1497+
// To make this work, user callbacks can't be on the main thread because the main thread is
1498+
// blocked waiting for the test to complete (that is, you can't await expectations on the main
1499+
// thread and then have the user callback additionally await expectations).
1500+
dispatch_queue_t userQueue = dispatch_queue_create("firestore.test.user", DISPATCH_QUEUE_SERIAL);
1501+
FIRFirestoreSettings *settings = self.db.settings;
1502+
settings.dispatchQueue = userQueue;
1503+
self.db.settings = settings;
1504+
14961505
XCTestExpectation *running = [self expectationWithDescription:@"listener running"];
14971506
XCTestExpectation *allowCompletion =
14981507
[self expectationWithDescription:@"allow listener to complete"];

Firestore/Source/API/FIRFirestore.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "Firestore/core/src/core/transaction.h"
4343
#include "Firestore/core/src/model/database_id.h"
4444
#include "Firestore/core/src/util/async_queue.h"
45+
#include "Firestore/core/src/util/config.h"
4546
#include "Firestore/core/src/util/empty.h"
4647
#include "Firestore/core/src/util/error_apple.h"
4748
#include "Firestore/core/src/util/exception.h"

0 commit comments

Comments
 (0)