Skip to content

Commit c6d833e

Browse files
tom-andersenchkuang-gAlmostMattDellaBittasunmou99
committed
Firestore COUNT (#1207)
* Firestore COUNT API (#1174) * Firestore COUNT API * Exempt from go/allstar check (#1173) * Token-changed listeners for iOS AppCheck (#1172) * [macOS sandbox mode] Application group name mangling for semaphores (#1167) When macOS Sandbox mode is enabled, macOS requires that semaphores have a name that is prefixed by the App's Group Name. If the semaphore's name doesn't match this convention then its creation fails. Unfortunately there's no official way for the SDK to query the app's group name at runtime, so we can't automatically mangle the semaphore names. Instead I've updated the SDK to use an Info.plist property named FBAppGroupEntitlementName on macOS. If that property is present then the SDK will use it's value to prefix the semaphore names. As an additional issue, the SDK attempted to detect semaphore creation errors by comparing the semaphore handle to nil. But in the case of macOS, a semaphore creation error returns SEM_FAILED which is 0xFFFFFFFFFFFFFFFF, not nil. And on Linux, sem_init returns -1. I've updated the corresponding platform implementations to detect the correct values for these errors. * Setup Desktop test workflow that detects C++ SDK breakage caused by iOS SDK changes (#1162) * [Bugfx] Fix Nightly Test Report template (#1181) * Reduce number of RewardedAd loads on iOS in CI (#1180) The GMA backend doesn't whitelist iOS devices running in CI which means number of ads that can be served to iOS in CI is restricted. This is true even when using the prescribed Demo Ad Unit Id. This PR reduces the number of ads we load on iOS in an attempt to minimize the chance of encountering NoFillErrors and push our CI to green. * Firestore COUNT implementation (WIP) * Firestore COUNT implementation (WIP) * Fix linting * Fix linting * Fix linking * Cleanup * Fix release notes * Format * Fixes from review * Formatting * Responding to PR comments. * Add Hash * Add Hash * Fix copyright year * Rename * Format * Rename * Fixup constructor/assignment parameter naming. * Format --------- Co-authored-by: chkuang-g <[email protected]> Co-authored-by: Matthew Hyndman <[email protected]> Co-authored-by: DellaBitta <[email protected]> Co-authored-by: Mou Sun <[email protected]> * Tomandersen/count test (#1206) * Fix linking * Cleanup * Responding to PR comments. * Rename * Rename * Fixup constructor/assignment parameter naming. * Add Test * Format * Add test * Add test * Format * Recognize NaN filter probelm * Add tests * Add tests * Add tests * Test is_valid() * Add constructor and assignment tests. * Rename variable * Format * Remove extra semicolon * Add self move assignment test * Format * Simplify * PR Followup (#1237) * Firestore COUNT API (#1174) * Firestore COUNT API * Exempt from go/allstar check (#1173) * Token-changed listeners for iOS AppCheck (#1172) * [macOS sandbox mode] Application group name mangling for semaphores (#1167) When macOS Sandbox mode is enabled, macOS requires that semaphores have a name that is prefixed by the App's Group Name. If the semaphore's name doesn't match this convention then its creation fails. Unfortunately there's no official way for the SDK to query the app's group name at runtime, so we can't automatically mangle the semaphore names. Instead I've updated the SDK to use an Info.plist property named FBAppGroupEntitlementName on macOS. If that property is present then the SDK will use it's value to prefix the semaphore names. As an additional issue, the SDK attempted to detect semaphore creation errors by comparing the semaphore handle to nil. But in the case of macOS, a semaphore creation error returns SEM_FAILED which is 0xFFFFFFFFFFFFFFFF, not nil. And on Linux, sem_init returns -1. I've updated the corresponding platform implementations to detect the correct values for these errors. * Setup Desktop test workflow that detects C++ SDK breakage caused by iOS SDK changes (#1162) * [Bugfx] Fix Nightly Test Report template (#1181) * Reduce number of RewardedAd loads on iOS in CI (#1180) The GMA backend doesn't whitelist iOS devices running in CI which means number of ads that can be served to iOS in CI is restricted. This is true even when using the prescribed Demo Ad Unit Id. This PR reduces the number of ads we load on iOS in an attempt to minimize the chance of encountering NoFillErrors and push our CI to green. * Firestore COUNT implementation (WIP) * Firestore COUNT implementation (WIP) * Fix linting * Fix linting * Fix linking * Cleanup * Fix release notes * Format * Fixes from review * Formatting * Responding to PR comments. * Add Hash * Add Hash * Fix copyright year * Rename * Format * Rename * Fixup constructor/assignment parameter naming. * Format --------- Co-authored-by: chkuang-g <[email protected]> Co-authored-by: Matthew Hyndman <[email protected]> Co-authored-by: DellaBitta <[email protected]> Co-authored-by: Mou Sun <[email protected]> * Tomandersen/count test (#1206) * Fix linking * Cleanup * Responding to PR comments. * Rename * Rename * Fixup constructor/assignment parameter naming. * Add Test * Format * Add test * Add test * Format * Recognize NaN filter probelm * Add tests * Add tests * Add tests * Test is_valid() * Add constructor and assignment tests. * Rename variable * Format * Remove extra semicolon * Add self move assignment test * Format * Simplify * Pretty --------- Co-authored-by: chkuang-g <[email protected]> Co-authored-by: Matthew Hyndman <[email protected]> Co-authored-by: DellaBitta <[email protected]> Co-authored-by: Mou Sun <[email protected]> * Tomandersen/count api (#1236) * Firestore COUNT API (#1174) * Firestore COUNT API * Exempt from go/allstar check (#1173) * Token-changed listeners for iOS AppCheck (#1172) * [macOS sandbox mode] Application group name mangling for semaphores (#1167) When macOS Sandbox mode is enabled, macOS requires that semaphores have a name that is prefixed by the App's Group Name. If the semaphore's name doesn't match this convention then its creation fails. Unfortunately there's no official way for the SDK to query the app's group name at runtime, so we can't automatically mangle the semaphore names. Instead I've updated the SDK to use an Info.plist property named FBAppGroupEntitlementName on macOS. If that property is present then the SDK will use it's value to prefix the semaphore names. As an additional issue, the SDK attempted to detect semaphore creation errors by comparing the semaphore handle to nil. But in the case of macOS, a semaphore creation error returns SEM_FAILED which is 0xFFFFFFFFFFFFFFFF, not nil. And on Linux, sem_init returns -1. I've updated the corresponding platform implementations to detect the correct values for these errors. * Setup Desktop test workflow that detects C++ SDK breakage caused by iOS SDK changes (#1162) * [Bugfx] Fix Nightly Test Report template (#1181) * Reduce number of RewardedAd loads on iOS in CI (#1180) The GMA backend doesn't whitelist iOS devices running in CI which means number of ads that can be served to iOS in CI is restricted. This is true even when using the prescribed Demo Ad Unit Id. This PR reduces the number of ads we load on iOS in an attempt to minimize the chance of encountering NoFillErrors and push our CI to green. * Firestore COUNT implementation (WIP) * Firestore COUNT implementation (WIP) * Fix linting * Fix linting * Fix linking * Cleanup * Fix release notes * Format * Fixes from review * Formatting * Responding to PR comments. * Add Hash * Add Hash * Fix copyright year * Rename * Format * Rename * Fixup constructor/assignment parameter naming. * Format --------- Co-authored-by: chkuang-g <[email protected]> Co-authored-by: Matthew Hyndman <[email protected]> Co-authored-by: DellaBitta <[email protected]> Co-authored-by: Mou Sun <[email protected]> * Fix linking * Cleanup * Responding to PR comments. * Rename * Rename * Fixup constructor/assignment parameter naming. * Add Test * Format * Add test * Add test * Format * Recognize NaN filter probelm * Add tests * Add tests * Add tests * Test is_valid() * Add constructor and assignment tests. * Rename variable * Format * Remove extra semicolon * Firestore COUNT API * [macOS sandbox mode] Application group name mangling for semaphores (#1167) When macOS Sandbox mode is enabled, macOS requires that semaphores have a name that is prefixed by the App's Group Name. If the semaphore's name doesn't match this convention then its creation fails. Unfortunately there's no official way for the SDK to query the app's group name at runtime, so we can't automatically mangle the semaphore names. Instead I've updated the SDK to use an Info.plist property named FBAppGroupEntitlementName on macOS. If that property is present then the SDK will use it's value to prefix the semaphore names. As an additional issue, the SDK attempted to detect semaphore creation errors by comparing the semaphore handle to nil. But in the case of macOS, a semaphore creation error returns SEM_FAILED which is 0xFFFFFFFFFFFFFFFF, not nil. And on Linux, sem_init returns -1. I've updated the corresponding platform implementations to detect the correct values for these errors. * Firestore COUNT implementation (WIP) * Firestore COUNT implementation (WIP) * Fix linting * Fix linting * Fix linking * Disable getSessionId test on emulators. (#1193) * Disable getSessionId test on Android emulator. * Also skip on iOS simulator. * Cleanup * Fix release notes * Format * Fixes from review * Formatting * Responding to PR comments. * Add Hash * Add Hash * Fix copyright year * Rename * Format * Rename * Fixup constructor/assignment parameter naming. * Format * Stub Android Impl * Tomandersen/count test (#1206) * Fix linking * Cleanup * Responding to PR comments. * Rename * Rename * Fixup constructor/assignment parameter naming. * Add Test * Format * Add test * Add test * Format * Recognize NaN filter probelm * Add tests * Add tests * Add tests * Test is_valid() * Add constructor and assignment tests. * Rename variable * Format * Remove extra semicolon * Add self move assignment test * Format * Simplify * JNI Count Implementation * Pretty * Fix according PR comments * Pretty --------- Co-authored-by: chkuang-g <[email protected]> Co-authored-by: Matthew Hyndman <[email protected]> Co-authored-by: DellaBitta <[email protected]> Co-authored-by: Mou Sun <[email protected]> Co-authored-by: Jon Simantov <[email protected]> * Fix * Revert Query Test changes. * Add separate file for count tests. * Changes from PR comments * Pretty --------- Co-authored-by: chkuang-g <[email protected]> Co-authored-by: Matthew Hyndman <[email protected]> Co-authored-by: DellaBitta <[email protected]> Co-authored-by: Mou Sun <[email protected]> Co-authored-by: Jon Simantov <[email protected]>
1 parent 2bbb9a7 commit c6d833e

40 files changed

+3153
-44
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ gcs_key_file.json
1919

2020
# Folders for cmake/test output
2121
*_build/
22-
*cmake-build-debug/
22+
cmake-build-*/
2323
testing/test_framework/external/
2424

2525
# XCode user specific folders

app/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,9 @@ if (IOS)
523523
${FIREBASE_SOURCE_DIR}/dynamic_links/src/include/firebase/dynamic_links/components.h)
524524
set(firestore_HDRS
525525
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore.h
526+
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/aggregate_query.h
527+
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/aggregate_query_snapshot.h
528+
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/aggregate_source.h
526529
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/collection_reference.h
527530
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/document_change.h
528531
${FIREBASE_SOURCE_DIR}/firestore/src/include/firebase/firestore/document_reference.h

firestore/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ else()
2020
endif()
2121

2222
set(common_SRCS
23+
src/common/aggregate_query.cc
24+
src/common/aggregate_query_snapshot.cc
2325
src/common/cleanup.h
2426
src/common/collection_reference.cc
2527
src/common/compiler_info.cc
@@ -65,6 +67,12 @@ binary_to_array("firestore_resources"
6567

6668
set(android_SRCS
6769
${firestore_resources_source}
70+
src/android/aggregate_query_android.cc
71+
src/android/aggregate_query_android.h
72+
src/android/aggregate_query_snapshot_android.cc
73+
src/android/aggregate_query_snapshot_android.h
74+
src/android/aggregate_source_android.cc
75+
src/android/aggregate_source_android.h
6876
src/android/blob_android.cc
6977
src/android/blob_android.h
7078
src/android/collection_reference_android.cc
@@ -185,6 +193,10 @@ set(android_SRCS
185193

186194
# Sources that apply to all non-Android platforms.
187195
set(main_SRCS
196+
src/main/aggregate_query_main.cc
197+
src/main/aggregate_query_main.h
198+
src/main/aggregate_query_snapshot_main.cc
199+
src/main/aggregate_query_snapshot_main.h
188200
src/main/collection_reference_main.cc
189201
src/main/collection_reference_main.h
190202
src/main/converter_main.h

firestore/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ a Python3 installation.
1919

2020
# Architecture
2121

22-
It is easier to work this Firestore CPP SDK by keeping a high level archetecture in mind:
22+
It is easier to work this Firestore CPP SDK by keeping a high level architecture in mind:
2323

2424
![architecture.png](architecture.png)
2525

firestore/integration_test_internal/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ set(FIREBASE_INTEGRATION_TEST_PORTABLE_TEST_SRCS
9191
# public API are performed.
9292
src/integration_test.cc
9393
# Internal tests below.
94+
src/aggregate_query_snapshot_test.cc
95+
src/aggregate_query_test.cc
9496
src/bundle_test.cc
9597
src/collection_reference_test.cc
9698
src/cursor_test.cc

0 commit comments

Comments
 (0)