From 77ac61ca4dfdd3c59a5de7bcdf16fb05dd6226f4 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Tue, 24 Sep 2024 09:53:41 -0700 Subject: [PATCH 01/13] Changelog updates for 11.3.0 (#13711) --- FirebaseAuth/CHANGELOG.md | 2 +- Firestore/CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FirebaseAuth/CHANGELOG.md b/FirebaseAuth/CHANGELOG.md index 57a5987609d..fd8371d582d 100644 --- a/FirebaseAuth/CHANGELOG.md +++ b/FirebaseAuth/CHANGELOG.md @@ -1,4 +1,4 @@ -# Unreleased +# 11.3.0 - [Fixed] Restore Firebase 10 behavior by querying with the `kSecAttrSynchronizable` key when auth state is set to be shared across devices. (#13584) diff --git a/Firestore/CHANGELOG.md b/Firestore/CHANGELOG.md index 0b72c4d470b..092e66027f8 100644 --- a/Firestore/CHANGELOG.md +++ b/Firestore/CHANGELOG.md @@ -1,4 +1,4 @@ -# Unreleased +# 11.3.0 - [changed] Improve efficiency of memory persistence when processing a large number of writes. (#13572) # 11.2.0 From e1d297258184202ceff39b4409d33da8f34a685d Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:41:19 -0400 Subject: [PATCH 02/13] [Infra] Fix warning in Auth's AuthWebViewController.swift (#13634) --- .../Swift/Utilities/AuthWebViewController.swift | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/FirebaseAuth/Sources/Swift/Utilities/AuthWebViewController.swift b/FirebaseAuth/Sources/Swift/Utilities/AuthWebViewController.swift index f476c0e06f5..c247eead731 100644 --- a/FirebaseAuth/Sources/Swift/Utilities/AuthWebViewController.swift +++ b/FirebaseAuth/Sources/Swift/Utilities/AuthWebViewController.swift @@ -96,17 +96,14 @@ // MARK: - WKNavigationDelegate - func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, - decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { + func webView(_ webView: WKWebView, + decidePolicyFor navigationAction: WKNavigationAction) async + -> WKNavigationActionPolicy { let canHandleURL = delegate?.webViewController( self, canHandle: navigationAction.request.url ?? url ) ?? false - if canHandleURL { - decisionHandler(.allow) - } else { - decisionHandler(.cancel) - } + return canHandleURL ? .allow : .cancel } func webView(_ webView: WKWebView, From 89ea60229e3f05114870c9b26c6d2b94f234f506 Mon Sep 17 00:00:00 2001 From: tsunghung <78230356+tsunghung@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:51:12 -0700 Subject: [PATCH 03/13] Analytics 11.3.0 (#13709) --- FirebaseAnalytics.podspec | 2 +- GoogleAppMeasurement.podspec | 2 +- Package.swift | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FirebaseAnalytics.podspec b/FirebaseAnalytics.podspec index 840bbf1fb04..8e33b6ff5a5 100644 --- a/FirebaseAnalytics.podspec +++ b/FirebaseAnalytics.podspec @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.authors = 'Google, Inc.' s.source = { - :http => 'https://dl.google.com/firebase/ios/analytics/ad70ce75cb9d5945/FirebaseAnalytics-11.1.0.tar.gz' + :http => 'https://dl.google.com/firebase/ios/analytics/7c5cc65f2b583ee1/FirebaseAnalytics-11.3.0.tar.gz' } s.cocoapods_version = '>= 1.12.0' diff --git a/GoogleAppMeasurement.podspec b/GoogleAppMeasurement.podspec index 5d8e9c7f469..f04df1e7e4e 100644 --- a/GoogleAppMeasurement.podspec +++ b/GoogleAppMeasurement.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.authors = 'Google, Inc.' s.source = { - :http => 'https://dl.google.com/firebase/ios/analytics/f60e4b9034ff4db0/GoogleAppMeasurement-11.1.0.tar.gz' + :http => 'https://dl.google.com/firebase/ios/analytics/d86efe4f4164be5a/GoogleAppMeasurement-11.3.0.tar.gz' } s.cocoapods_version = '>= 1.12.0' diff --git a/Package.swift b/Package.swift index 26d896416d1..ce9d632e330 100644 --- a/Package.swift +++ b/Package.swift @@ -303,8 +303,8 @@ let package = Package( ), .binaryTarget( name: "FirebaseAnalytics", - url: "https://dl.google.com/firebase/ios/swiftpm/11.1.0/FirebaseAnalytics.zip", - checksum: "7477b92093cc001e713a3442bcf8725b83764294452c04f36164c8706d224510" + url: "https://dl.google.com/firebase/ios/swiftpm/11.3.0/FirebaseAnalytics.zip", + checksum: "1d4c06ccb6ffbf44e80934ab9190d2473421f94e7116c95c13cb2744c3873852" ), .testTarget( name: "AnalyticsSwiftUnit", @@ -1342,7 +1342,7 @@ func googleAppMeasurementDependency() -> Package.Dependency { return .package(url: appMeasurementURL, branch: "main") } - return .package(url: appMeasurementURL, exact: "11.1.0") + return .package(url: appMeasurementURL, exact: "11.3.0") } func abseilDependency() -> Package.Dependency { From 56b1bda7031801b1950e48d74b51b3f8f6926691 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Tue, 24 Sep 2024 10:51:54 -0700 Subject: [PATCH 04/13] Ensure test of recent TagManager (#13710) --- SymbolCollisionTest/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SymbolCollisionTest/Podfile b/SymbolCollisionTest/Podfile index 7a7f0122b6a..2d92ae6638e 100644 --- a/SymbolCollisionTest/Podfile +++ b/SymbolCollisionTest/Podfile @@ -49,7 +49,7 @@ target 'SymbolCollisionTest' do pod 'GooglePlaces', '> 8' pod 'GoogleSignIn', '> 6' pod 'GTMAppAuth' - pod 'GoogleTagManager' + pod 'GoogleTagManager', '>= 7.4.6' pod 'GoogleToolboxForMac' pod 'GoogleUtilities' # pod 'GTMHTTPFetcher' - conflicts with GTMSessionFetcher From 70558c913016bf468a54e507723b9cb2e8e802bc Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Tue, 24 Sep 2024 11:21:23 -0700 Subject: [PATCH 05/13] RC: fix internal API nullability issue caught by analyzer (#13712) --- FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h | 3 ++- FirebaseRemoteConfig/Sources/RCNConfigFetch.m | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h b/FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h index dbef87d206a..58113944c18 100644 --- a/FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h +++ b/FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h @@ -53,7 +53,8 @@ typedef void (^RCNConfigFetchCompletion)(FIRRemoteConfigFetchStatus status, /// @param expirationDuration Expiration duration, in seconds. /// @param completionHandler Callback handler. - (void)fetchConfigWithExpirationDuration:(NSTimeInterval)expirationDuration - completionHandler:(FIRRemoteConfigFetchCompletion)completionHandler; + completionHandler: + (_Nullable FIRRemoteConfigFetchCompletion)completionHandler; /// Fetches config data immediately, keyed by namespace. Completion block will be called on the main /// queue. diff --git a/FirebaseRemoteConfig/Sources/RCNConfigFetch.m b/FirebaseRemoteConfig/Sources/RCNConfigFetch.m index dbc4b9bec56..3fad2694b02 100644 --- a/FirebaseRemoteConfig/Sources/RCNConfigFetch.m +++ b/FirebaseRemoteConfig/Sources/RCNConfigFetch.m @@ -131,7 +131,8 @@ - (void)dealloc { #pragma mark - Fetch Config API - (void)fetchConfigWithExpirationDuration:(NSTimeInterval)expirationDuration - completionHandler:(FIRRemoteConfigFetchCompletion)completionHandler { + completionHandler: + (_Nullable FIRRemoteConfigFetchCompletion)completionHandler { // Note: We expect the googleAppID to always be available. BOOL hasDeviceContextChanged = FIRRemoteConfigHasDeviceContextChanged(_settings.deviceContext, _options.googleAppID); From ce468fadee5ec2591c89e3bed9667c217bd8b995 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:22:42 -0400 Subject: [PATCH 06/13] [Auth] nil out SafariViewController when presentation finishes (#13715) --- FirebaseAuth/CHANGELOG.md | 2 ++ FirebaseAuth/Sources/Swift/Utilities/AuthURLPresenter.swift | 1 + 2 files changed, 3 insertions(+) diff --git a/FirebaseAuth/CHANGELOG.md b/FirebaseAuth/CHANGELOG.md index fd8371d582d..71cb75a1d05 100644 --- a/FirebaseAuth/CHANGELOG.md +++ b/FirebaseAuth/CHANGELOG.md @@ -5,6 +5,8 @@ - [Fixed] Prevent a bad memory access crash by using non-ObjC, native Swift types in the SDK's networking layer, and moving synchronous work off of the shared Swift concurrency queue. (#13650) +- [Fixed] Restore Firebase 10 behavior by forwarding errors from interrupted + reCAPTCHA or OIDC login flows. (#13645) # 11.2.0 - [Fixed] Fixed crashes that could occur in Swift continuation blocks running in the Xcode 16 diff --git a/FirebaseAuth/Sources/Swift/Utilities/AuthURLPresenter.swift b/FirebaseAuth/Sources/Swift/Utilities/AuthURLPresenter.swift index a9a62bf88b2..c59ced1cfe1 100644 --- a/FirebaseAuth/Sources/Swift/Utilities/AuthURLPresenter.swift +++ b/FirebaseAuth/Sources/Swift/Utilities/AuthURLPresenter.swift @@ -89,6 +89,7 @@ func safariViewControllerDidFinish(_ controller: SFSafariViewController) { kAuthGlobalWorkQueue.async { if controller == self.safariViewController { + self.safariViewController = nil // TODO: Ensure that the SFSafariViewController is actually removed from the screen // before invoking finishPresentation self.finishPresentation(withURL: nil, From 335f3d27b82af895a04ab3f2b9a519ed537fb4cc Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:34:24 -0400 Subject: [PATCH 07/13] [Auth] Match Firebase 10 implementation in WKNavigationDelegate conformance (#13714) --- .../Sources/Swift/Utilities/AuthWebViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FirebaseAuth/Sources/Swift/Utilities/AuthWebViewController.swift b/FirebaseAuth/Sources/Swift/Utilities/AuthWebViewController.swift index c247eead731..ee954b0029f 100644 --- a/FirebaseAuth/Sources/Swift/Utilities/AuthWebViewController.swift +++ b/FirebaseAuth/Sources/Swift/Utilities/AuthWebViewController.swift @@ -99,11 +99,11 @@ func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction) async -> WKNavigationActionPolicy { - let canHandleURL = delegate?.webViewController( + _ = delegate?.webViewController( self, canHandle: navigationAction.request.url ?? url - ) ?? false - return canHandleURL ? .allow : .cancel + ) + return .allow } func webView(_ webView: WKWebView, From 3d61c54be01913f2ce895befefbbb55468e355c3 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:46:43 -0400 Subject: [PATCH 08/13] [Infra] Switch back to building Auth with `-warnings-as-errors` (#13713) --- FirebaseAuth.podspec | 4 +--- FirebaseAuth/Tests/Unit/SwiftAPI.swift | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/FirebaseAuth.podspec b/FirebaseAuth.podspec index 7c35e277736..5bb6a6b1eec 100644 --- a/FirebaseAuth.podspec +++ b/FirebaseAuth.podspec @@ -48,13 +48,11 @@ supports email and password accounts, as well as several 3rd party authenticatio 'FirebaseAuth/README.md', 'FirebaseAuth/CHANGELOG.md' ] - # TODO(#13704) Restore warnings-as-errors checking. - # 'OTHER_SWIFT_FLAGS' => "$(inherited) #{ENV.key?('FIREBASE_CI') ? '-D FIREBASE_CI -warnings-as-errors' : ''}" s.pod_target_xcconfig = { 'GCC_C_LANGUAGE_STANDARD' => 'c99', # The second path is to find FirebaseAuth-Swift.h from a pod gen project 'HEADER_SEARCH_PATHS' => '"${PODS_TARGET_SRCROOT}" "${OBJECT_FILE_DIR_normal}/${NATIVE_ARCH_ACTUAL}"', - 'OTHER_SWIFT_FLAGS' => "$(inherited) #{ENV.key?('FIREBASE_CI') ? '-D FIREBASE_CI' : ''}" + 'OTHER_SWIFT_FLAGS' => "$(inherited) #{ENV.key?('FIREBASE_CI') ? '-D FIREBASE_CI -warnings-as-errors' : ''}" } s.framework = 'Security' s.ios.framework = 'SafariServices' diff --git a/FirebaseAuth/Tests/Unit/SwiftAPI.swift b/FirebaseAuth/Tests/Unit/SwiftAPI.swift index c508199088f..481d5bd92c8 100644 --- a/FirebaseAuth/Tests/Unit/SwiftAPI.swift +++ b/FirebaseAuth/Tests/Unit/SwiftAPI.swift @@ -365,7 +365,7 @@ class AuthAPI_hOnlyTests: XCTestCase { @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) func FIRFedederatedAuthProvider_hAsync() async throws { let obj = FederatedAuthImplementation() - try await _ = obj.credential(with: nil) + _ = try await obj.credential(with: nil) } } #endif From 96ca3cd67deadcf565ed10fc4102458b5370d9ae Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Tue, 24 Sep 2024 15:29:57 -0700 Subject: [PATCH 09/13] CI updates for visionOS and Xcode 16: part 2 (#13708) --- .github/workflows/abtesting.yml | 2 + .github/workflows/appdistribution.yml | 2 + .github/workflows/auth.yml | 85 ++++++++++++------------ .github/workflows/core.yml | 49 +++++++++----- .github/workflows/core_extension.yml | 8 +-- .github/workflows/core_internal.yml | 48 ++++++++----- .github/workflows/crashlytics.yml | 52 +++++++++------ .github/workflows/database.yml | 54 +++++++++------ .github/workflows/dynamiclinks.yml | 46 ++++++++----- .github/workflows/firebase_app_check.yml | 47 ++++++++----- .github/workflows/firestore.yml | 41 ++++++++---- .github/workflows/functions.yml | 60 ++++++++++------- .github/workflows/inappmessaging.yml | 46 ++++++++----- .github/workflows/installations.yml | 49 +++++++++----- .github/workflows/messaging.yml | 53 ++++++++++----- .github/workflows/mlmodeldownloader.yml | 49 +++++++++----- .github/workflows/performance.yml | 44 ++++++++---- .github/workflows/remoteconfig.yml | 54 +++++++++------ .github/workflows/sessions.yml | 47 ++++++++----- .github/workflows/shared-swift.yml | 49 +++++++++----- .github/workflows/spm.yml | 64 ++++++++++++------ .github/workflows/storage.yml | 55 +++++++++------ 22 files changed, 642 insertions(+), 362 deletions(-) diff --git a/.github/workflows/abtesting.yml b/.github/workflows/abtesting.yml index 00cb6e22b6b..e16cb3ddb82 100644 --- a/.github/workflows/abtesting.yml +++ b/.github/workflows/abtesting.yml @@ -43,6 +43,8 @@ jobs: command: scripts/pod_lib_lint.rb FirebaseABTesting.podspec --platforms=${{ matrix.target }} spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 runs-on: macos-14 outputs: cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} diff --git a/.github/workflows/appdistribution.yml b/.github/workflows/appdistribution.yml index 1c34f2e97eb..8c80ed4116c 100644 --- a/.github/workflows/appdistribution.yml +++ b/.github/workflows/appdistribution.yml @@ -38,6 +38,8 @@ jobs: --platforms=${{ matrix.target }} spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 runs-on: macos-14 outputs: cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} diff --git a/.github/workflows/auth.yml b/.github/workflows/auth.yml index 6e6058dc0f3..e9169e19701 100644 --- a/.github/workflows/auth.yml +++ b/.github/workflows/auth.yml @@ -78,50 +78,10 @@ jobs: retry_wait_seconds: 120 command: scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} ${{ matrix.tests }} --allow-warnings - integration-tests: - # Don't run on private repo unless it is a PR. - if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' - strategy: - matrix: - scheme: [ObjCApiTests, SwiftApiTests, AuthenticationExampleUITests] - + spm-package-resolved: env: - plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 runs-on: macos-14 - steps: - - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 - with: - cache_key: integration-tests${{ matrix.os }} - - name: Install Secrets - run: | - scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \ - FirebaseAuth/Tests/SampleSwift/ObjCApiTests/AuthCredentials.h "$plist_secret" - scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg \ - FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SwiftApplication.plist "$plist_secret" - scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \ - FirebaseAuth/Tests/SampleSwift/AuthCredentials.h "$plist_secret" - scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \ - FirebaseAuth/Tests/SampleSwift/GoogleService-Info.plist "$plist_secret" - scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \ - FirebaseAuth/Tests/SampleSwift/GoogleService-Info_multi.plist "$plist_secret" - scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \ - FirebaseAuth/Tests/SampleSwift/Sample.entitlements "$plist_secret" - scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \ - FirebaseAuth/Tests/SampleSwift/SwiftApiTests/Credentials.swift "$plist_secret" - - name: Xcode - run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer - - uses: nick-fields/retry@v3 - with: - timeout_minutes: 120 - max_attempts: 3 - retry_on: error - retry_wait_seconds: 120 - command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }}) - - spm-package-resolved: - runs-on: macos-14 outputs: cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} steps: @@ -169,6 +129,49 @@ jobs: retry_wait_seconds: 120 command: scripts/third_party/travis/retry.sh ./scripts/build.sh AuthUnit ${{ matrix.target }} + integration-tests: + # Don't run on private repo unless it is a PR. + if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] + strategy: + matrix: + scheme: [ObjCApiTests, SwiftApiTests, AuthenticationExampleUITests] + env: + plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + - uses: actions/cache/restore@v4 + with: + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} + - name: Install Secrets + run: | + scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthCredentials.h.gpg \ + FirebaseAuth/Tests/SampleSwift/ObjCApiTests/AuthCredentials.h "$plist_secret" + scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/SwiftApplication.plist.gpg \ + FirebaseAuth/Tests/SampleSwift/AuthenticationExample/SwiftApplication.plist "$plist_secret" + scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/AuthCredentials.h.gpg \ + FirebaseAuth/Tests/SampleSwift/AuthCredentials.h "$plist_secret" + scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info.plist.gpg \ + FirebaseAuth/Tests/SampleSwift/GoogleService-Info.plist "$plist_secret" + scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/GoogleService-Info_multi.plist.gpg \ + FirebaseAuth/Tests/SampleSwift/GoogleService-Info_multi.plist "$plist_secret" + scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Sample.entitlements.gpg \ + FirebaseAuth/Tests/SampleSwift/Sample.entitlements "$plist_secret" + scripts/decrypt_gha_secret.sh scripts/gha-encrypted/AuthSample/Credentials.swift.gpg \ + FirebaseAuth/Tests/SampleSwift/SwiftApiTests/Credentials.swift "$plist_secret" + - name: Xcode + run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer + - uses: nick-fields/retry@v3 + with: + timeout_minutes: 120 + max_attempts: 3 + retry_on: error + retry_wait_seconds: 120 + command: ([ -z $plist_secret ] || scripts/build.sh Auth iOS ${{ matrix.scheme }}) + catalyst: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index d4913b5a428..d8f420f2af3 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -22,12 +22,8 @@ jobs: matrix: # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532 target: [ios, tvos, macos --skip-tests, watchos] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -39,28 +35,45 @@ jobs: - name: Build and test run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCore.podspec --platforms=${{ matrix.target }} + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/core_extension.yml b/.github/workflows/core_extension.yml index 1afaa4bb3de..b728bbc3bff 100644 --- a/.github/workflows/core_extension.yml +++ b/.github/workflows/core_extension.yml @@ -20,12 +20,8 @@ jobs: strategy: matrix: target: [ios, tvos, macos, watchos] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/core_internal.yml b/.github/workflows/core_internal.yml index 916e4d2a6b0..c1b38b07422 100644 --- a/.github/workflows/core_internal.yml +++ b/.github/workflows/core_internal.yml @@ -18,12 +18,8 @@ jobs: strategy: matrix: target: [ios, tvos, macos, watchos] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -35,25 +31,45 @@ jobs: - name: Build and test run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseCoreInternal.podspec --platforms=${{ matrix.target }} + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + - uses: actions/cache/restore@v4 + with: + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Initialize xcodebuild run: scripts/setup_spm_tests.sh - name: Xcode diff --git a/.github/workflows/crashlytics.yml b/.github/workflows/crashlytics.yml index 124e2121b8f..ef4c0ba650c 100644 --- a/.github/workflows/crashlytics.yml +++ b/.github/workflows/crashlytics.yml @@ -25,18 +25,12 @@ jobs: strategy: matrix: target: [ios, tvos, macos, watchos --skip-tests] - os: [macos-14, macos-13] + os: [macos-14] flags: [ '--use-modular-headers', '' ] - include: - - os: macos-14 - xcode: Xcode_15.3 - tests: --skip-tests - - os: macos-13 - xcode: Xcode_15.2 - tests: + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -53,28 +47,46 @@ jobs: retry_wait_seconds: 120 command: scripts/pod_lib_lint.rb FirebaseCrashlytics.podspec --platforms=${{ matrix.target }} ${{ matrix.tests }} ${{ matrix.flags }} + + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index 4ff6742cfc2..17b1db109e6 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -25,16 +25,9 @@ jobs: if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' strategy: matrix: - # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532 target: [ios, tvos, macos --skip-tests, watchos] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - tests: --skip-tests - - os: macos-13 - xcode: Xcode_15.2 - tests: --test-specs=unit + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -44,7 +37,7 @@ jobs: - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Build and test - run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec ${{ matrix.tests }} --platforms=${{ matrix.target }} + run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDatabase.podspec --test-specs=unit --platforms=${{ matrix.target }} integration: # Don't run on private repo unless it is a PR. @@ -64,28 +57,45 @@ jobs: # Only iOS to mitigate flakes. run: scripts/third_party/travis/retry.sh scripts/build.sh Database iOS integration + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/dynamiclinks.yml b/.github/workflows/dynamiclinks.yml index 589825221e8..4fcd9624616 100644 --- a/.github/workflows/dynamiclinks.yml +++ b/.github/workflows/dynamiclinks.yml @@ -22,12 +22,8 @@ jobs: strategy: matrix: - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -39,24 +35,44 @@ jobs: - name: FirebaseDynamicLinks run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseDynamicLinks.podspec --allow-warnings + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/firebase_app_check.yml b/.github/workflows/firebase_app_check.yml index a4b03fe4a64..d001709535a 100644 --- a/.github/workflows/firebase_app_check.yml +++ b/.github/workflows/firebase_app_check.yml @@ -21,14 +21,9 @@ jobs: strategy: matrix: podspec: [FirebaseAppCheckInterop.podspec, FirebaseAppCheck.podspec] - # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532 target: [ios, tvos, macos --skip-tests, watchos] - os: [macos-14, macos-13] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -96,25 +91,45 @@ jobs: # TODO: Remove --allow-warnings when stabilized. run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAppCheck.podspec --platforms=ios ${{ matrix.flags }} + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/firestore.yml b/.github/workflows/firestore.yml index 1c684ee5c50..4c98182f859 100644 --- a/.github/workflows/firestore.yml +++ b/.github/workflows/firestore.yml @@ -352,7 +352,7 @@ jobs: if: | (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || (github.event_name == 'pull_request') - runs-on: macos-13 + runs-on: macos-14 strategy: matrix: podspec: [ @@ -406,7 +406,7 @@ jobs: platforms: 'ios' include: - os: macos-14 - xcode: Xcode_15.3 + xcode: Xcode_16 - os: macos-13 xcode: Xcode_15.2 runs-on: ${{ matrix.os }} @@ -429,8 +429,32 @@ jobs: --allow-warnings \ --no-analyze + spm-package-resolved: + runs-on: macos-14 + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + FIREBASE_SOURCE_FIRESTORE: 1 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm-source: - needs: check + needs: [check, spm-package-resolved] # Either a scheduled run from public repo, or a pull request with firestore changes. if: | (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || @@ -438,15 +462,8 @@ jobs: strategy: matrix: target: [iOS, tvOS, macOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} env: FIREBASE_SOURCE_FIRESTORE: 1 diff --git a/.github/workflows/functions.yml b/.github/workflows/functions.yml index 32e9dffcb01..d4207217be3 100644 --- a/.github/workflows/functions.yml +++ b/.github/workflows/functions.yml @@ -30,12 +30,8 @@ jobs: strategy: matrix: target: [ios, tvos, macos, watchos] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -52,24 +48,47 @@ jobs: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseFunctions.podspec \ --test-specs=unit --platforms=${{ matrix.target }} + + spm-package-resolved: + runs-on: macos-14 + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm-integration: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: os: [macos-14] - include: - - os: macos-14 - xcode: Xcode_15.3 + xcode: [Xcode_15.4] runs-on: ${{ matrix.os }} env: FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Initialize xcodebuild run: scripts/setup_spm_tests.sh - name: Integration Test Server @@ -86,24 +105,19 @@ jobs: spm-unit: # Don't run on private repo. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/inappmessaging.yml b/.github/workflows/inappmessaging.yml index 76eea952f23..c766fd89f31 100644 --- a/.github/workflows/inappmessaging.yml +++ b/.github/workflows/inappmessaging.yml @@ -24,12 +24,8 @@ jobs: strategy: matrix: podspec: [FirebaseInAppMessaging.podspec] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -66,24 +62,44 @@ jobs: - name: Build and test run: scripts/third_party/travis/retry.sh scripts/build.sh InAppMessaging ${{ matrix.platform }} xcodebuild + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/installations.yml b/.github/workflows/installations.yml index 94e7c7831e0..5fe5174fa9a 100644 --- a/.github/workflows/installations.yml +++ b/.github/workflows/installations.yml @@ -25,13 +25,13 @@ jobs: matrix: # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532 target: [ios, tvos, macos --skip-tests, watchos] - os: [macos-14, macos-13] + os: [macos-14] include: - os: macos-14 xcode: Xcode_15.3 test-specs: unit,integration - - os: macos-13 - xcode: Xcode_15.2 + - os: macos-14 + xcode: Xcode_16 test-specs: unit runs-on: ${{ matrix.os }} steps: @@ -57,29 +57,44 @@ jobs: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseInstallations.podspec \ --platforms=${{ matrix.target }} --test-specs=--platforms=${{ matrix.test-specs }} + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: - # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532 - target: [iOS, tvOS, macOS, watchOS, catalyst] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + target: [iOS, tvOS, macOS, catalyst, watchOS] + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/messaging.yml b/.github/workflows/messaging.yml index 151166c5715..acc9d6d8c2c 100644 --- a/.github/workflows/messaging.yml +++ b/.github/workflows/messaging.yml @@ -29,7 +29,7 @@ jobs: if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' env: plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} - runs-on: macos-13 + runs-on: macos-14 steps: - uses: actions/checkout@v4 - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 @@ -59,13 +59,13 @@ jobs: matrix: podspec: [FirebaseMessagingInterop.podspec, FirebaseMessaging.podspec] target: [ios, tvos, macos --skip-tests, watchos --skip-tests] # skipping tests on mac because of keychain access - os: [macos-14, macos-13] + os: [macos-14] include: - os: macos-14 xcode: Xcode_15.3 tests: --test-specs=unit - - os: macos-13 - xcode: Xcode_15.2 + - os: macos-14 + xcode: Xcode_16 tests: --skip-tests runs-on: ${{ matrix.os }} steps: @@ -78,34 +78,51 @@ jobs: - name: Build and test run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} ${{ matrix.tests }} --platforms=${{ matrix.target }} + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: - target: [iOS, watchOS, tvOS, macOS, catalyst] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + target: [iOS spm, tvOS spmbuildonly, macOS spmbuildonly, catalyst spmbuildonly, watchOS spmbuildonly] + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Initialize xcodebuild run: scripts/setup_spm_tests.sh - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }} spm + run: scripts/third_party/travis/retry.sh ./scripts/build.sh MessagingUnit ${{ matrix.target }} catalyst: # Don't run on private repo unless it is a PR. diff --git a/.github/workflows/mlmodeldownloader.yml b/.github/workflows/mlmodeldownloader.yml index a0d2cd992cc..feae6c76383 100644 --- a/.github/workflows/mlmodeldownloader.yml +++ b/.github/workflows/mlmodeldownloader.yml @@ -22,12 +22,8 @@ jobs: strategy: matrix: target: [ios, tvos, macos, watchos] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -70,27 +66,44 @@ jobs: - name: PodLibLint MLModelDownloader Cron run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseMLModelDownloader.podspec --platforms=${{ matrix.target }} --use-static-frameworks + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 29aa3176bb6..f58bb912a18 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -55,12 +55,8 @@ jobs: strategy: matrix: target: [ios, tvos] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -123,24 +119,44 @@ jobs: testapp_dir: quickstart-ios/build-for-testing test_type: "xctest" + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/remoteconfig.yml b/.github/workflows/remoteconfig.yml index fe576403f5d..200c19801cf 100644 --- a/.github/workflows/remoteconfig.yml +++ b/.github/workflows/remoteconfig.yml @@ -58,20 +58,19 @@ jobs: if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' strategy: - max-parallel: 1 matrix: # TODO: macos tests are blocked by https://github.com/erikdoe/ocmock/pull/532 target: [ios, tvos, macos --skip-tests, watchos] podspec: [FirebaseRemoteConfig.podspec] - os: [macos-14, macos-13] + os: [macos-14] include: - os: macos-14 xcode: Xcode_15.3 # TODO(#13078): Fix testing infra to enforce warnings again. tests: --allow-warnings # Flaky tests on CI - - os: macos-13 - xcode: Xcode_15.2 + - os: macos-14 + xcode: Xcode_16 tests: --skip-tests runs-on: ${{ matrix.os }} steps: @@ -86,38 +85,53 @@ jobs: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb ${{ matrix.podspec }} --platforms=${{ matrix.target }} \ ${{ matrix.tests }} + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - test: spmbuildonly - - os: macos-14 - xcode: Xcode_15.3 - test: spmbuildonly - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS - test: spm + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild run: scripts/setup_spm_tests.sh - name: Unit Tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigUnit ${{ matrix.target }} ${{ matrix.test }} + run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigUnit ${{ matrix.target }} spm - name: Fake Console tests - run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigFakeConsole ${{ matrix.target }} ${{ matrix.test }} + run: scripts/third_party/travis/retry.sh ./scripts/build.sh RemoteConfigFakeConsole ${{ matrix.target }} spm catalyst: # Don't run on private repo unless it is a PR. diff --git a/.github/workflows/sessions.yml b/.github/workflows/sessions.yml index a80387bab95..c4edb685e1f 100644 --- a/.github/workflows/sessions.yml +++ b/.github/workflows/sessions.yml @@ -24,14 +24,14 @@ jobs: strategy: matrix: target: [ios, tvos, macos, watchos] - os: [macos-14, macos-13] + os: [macos-14] include: - os: macos-14 xcode: Xcode_15.3 tests: # Flaky tests on CI - - os: macos-13 - xcode: Xcode_15.2 + - os: macos-14 + xcode: Xcode_16 tests: --skip-tests runs-on: ${{ matrix.os }} steps: @@ -49,28 +49,45 @@ jobs: retry_wait_seconds: 120 command: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSessions.podspec --platforms=${{ matrix.target }} ${{ matrix.tests }} + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/shared-swift.yml b/.github/workflows/shared-swift.yml index 4b6ea4a12e1..40f1d46fa19 100644 --- a/.github/workflows/shared-swift.yml +++ b/.github/workflows/shared-swift.yml @@ -24,12 +24,8 @@ jobs: strategy: matrix: target: [ios, tvos, macos, watchos] - os: [macos-14, macos-13] - include: - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -41,28 +37,45 @@ jobs: - name: Build and test run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSharedSwift.podspec --platforms=${{ matrix.target }} + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 5557f1b2865..fec6410ca5d 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -22,27 +22,50 @@ concurrency: cancel-in-progress: true jobs: + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + swift-build-run: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: - os: [macos-14, macos-13] + os: [macos-14] include: - # The integration tests are slow and flaky on Xcode 15, so just build. - - os: macos-13 - xcode: Xcode_15.2 - test: spmbuildonly + - os: macos-14 + xcode: Xcode_16 + test: spm - os: macos-14 xcode: Xcode_15.3 test: spm runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Clone mock responses for Vertex AI unit tests run: scripts/update_vertexai_responses.sh - name: Xcode @@ -63,20 +86,22 @@ jobs: iOS-Device: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: matrix: - os: [macos-14, macos-13] + os: [macos-14] include: - os: macos-14 xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + - os: macos-14 + xcode: Xcode_16 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: device${{ matrix.os }}${{ matrix.xcode }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Clone mock responses for Vertex AI unit tests run: scripts/update_vertexai_responses.sh - name: Xcode @@ -89,25 +114,26 @@ jobs: platforms: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' - + needs: [spm-package-resolved] strategy: matrix: # Full set of Firebase-Package tests only run on iOS. Run subset on other platforms. # visionOS isn't buildable from here (even with Firestore source) because the test # targets need Analytics. target: [tvOS, macOS, catalyst] - os: [macos-13, macos-14] + os: [macos-14] include: - - os: macos-13 - xcode: Xcode_15.2 + - os: macos-14 + xcode: Xcode_16 - os: macos-14 xcode: Xcode_15.3 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: platforms${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcode run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app/Contents/Developer - name: Initialize xcodebuild diff --git a/.github/workflows/storage.yml b/.github/workflows/storage.yml index 1c1bb861e30..b93f4b9141d 100644 --- a/.github/workflows/storage.yml +++ b/.github/workflows/storage.yml @@ -25,7 +25,7 @@ jobs: language: [Swift, ObjC] include: - os: macos-14 - xcode: Xcode_15.3 + xcode: Xcode_15.4 env: plist_secret: ${{ secrets.GHASecretsGPGPassphrase1 }} runs-on: ${{ matrix.os }} @@ -59,28 +59,45 @@ jobs: retry_wait_seconds: 120 command: ([ -z $plist_secret ] || scripts/build.sh Storage${{ matrix.language }} all) + spm-package-resolved: + env: + FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1 + runs-on: macos-14 + outputs: + cache_key: ${{ steps.generate_cache_key.outputs.cache_key }} + steps: + - uses: actions/checkout@v4 + - name: Generate Swift Package.resolved + id: swift_package_resolve + run: | + swift package resolve + - name: Generate cache key + id: generate_cache_key + run: | + cache_key="${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}" + echo "cache_key=${cache_key}" >> "$GITHUB_OUTPUT" + - uses: actions/cache/save@v4 + id: cache + with: + path: .build + key: ${{ steps.generate_cache_key.outputs.cache_key }} + spm: # Don't run on private repo unless it is a PR. if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request' + needs: [spm-package-resolved] strategy: - max-parallel: 1 matrix: target: [iOS, tvOS, macOS, catalyst, watchOS] - os: [macos-13, macos-14] - include: - - os: macos-13 - xcode: Xcode_15.2 - - os: macos-14 - xcode: Xcode_15.3 - - os: macos-14 - xcode: Xcode_15.3 - target: visionOS + os: [macos-14] + xcode: [Xcode_15.2, Xcode_16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126 + - uses: actions/cache/restore@v4 with: - cache_key: spm-cron${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }} + path: .build + key: ${{needs.spm-package-resolved.outputs.cache_key}} - name: Xcodes run: ls -l /Applications/Xcode* - name: Xcode @@ -156,13 +173,13 @@ jobs: strategy: matrix: target: [ios, tvos, macos, watchos] - os: [macos-14, macos-13] + os: [macos-14] include: - os: macos-14 xcode: Xcode_15.3 tests: --skip-tests - - os: macos-13 - xcode: Xcode_15.2 + - os: macos-14 + xcode: Xcode_16 tests: --test-specs=unit runs-on: ${{ matrix.os }} steps: @@ -185,12 +202,12 @@ jobs: strategy: matrix: target: [ios, tvos, macos, watchos] - os: [macos-14, macos-13] + os: [macos-14] include: - os: macos-14 xcode: Xcode_15.3 - - os: macos-13 - xcode: Xcode_15.2 + - os: macos-14 + xcode: Xcode_16 runs-on: ${{ matrix.os }} needs: pod-lib-lint steps: From 2893101579e85ea93790a7f2e7a39b323401bb7e Mon Sep 17 00:00:00 2001 From: Tom Andersen Date: Wed, 25 Sep 2024 09:08:58 -0400 Subject: [PATCH 10/13] SessionToken persistence implementation (#13684) Co-authored-by: Wu-Hui --- Firestore/CHANGELOG.md | 1 + .../Firestore.xcodeproj/project.pbxproj | 44 ++++++++++++ Firestore/core/src/local/globals_cache.h | 57 +++++++++++++++ .../core/src/local/leveldb_globals_cache.cc | 57 +++++++++++++++ .../core/src/local/leveldb_globals_cache.h | 52 ++++++++++++++ Firestore/core/src/local/leveldb_key.cc | 36 ++++++++++ Firestore/core/src/local/leveldb_key.h | 35 +++++++++ .../core/src/local/leveldb_persistence.cc | 5 ++ .../core/src/local/leveldb_persistence.h | 4 ++ .../core/src/local/memory_globals_cache.cc | 33 +++++++++ .../core/src/local/memory_globals_cache.h | 49 +++++++++++++ .../core/src/local/memory_persistence.cc | 4 ++ Firestore/core/src/local/memory_persistence.h | 5 ++ Firestore/core/src/local/persistence.h | 6 ++ .../test/unit/local/globals_cache_test.cc | 71 +++++++++++++++++++ .../core/test/unit/local/globals_cache_test.h | 59 +++++++++++++++ .../unit/local/leveldb_globals_cache_test.cc | 38 ++++++++++ .../unit/local/memory_globals_cache_test.cc | 38 ++++++++++ 18 files changed, 594 insertions(+) create mode 100644 Firestore/core/src/local/globals_cache.h create mode 100644 Firestore/core/src/local/leveldb_globals_cache.cc create mode 100644 Firestore/core/src/local/leveldb_globals_cache.h create mode 100644 Firestore/core/src/local/memory_globals_cache.cc create mode 100644 Firestore/core/src/local/memory_globals_cache.h create mode 100644 Firestore/core/test/unit/local/globals_cache_test.cc create mode 100644 Firestore/core/test/unit/local/globals_cache_test.h create mode 100644 Firestore/core/test/unit/local/leveldb_globals_cache_test.cc create mode 100644 Firestore/core/test/unit/local/memory_globals_cache_test.cc diff --git a/Firestore/CHANGELOG.md b/Firestore/CHANGELOG.md index 092e66027f8..dac0c7dbcdc 100644 --- a/Firestore/CHANGELOG.md +++ b/Firestore/CHANGELOG.md @@ -1,5 +1,6 @@ # 11.3.0 - [changed] Improve efficiency of memory persistence when processing a large number of writes. (#13572) +- [changed] Prepare Firestore cache to support session token. # 11.2.0 - [fixed] Marked all public classes with only readonly properties as `Sendable` to address diff --git a/Firestore/Example/Firestore.xcodeproj/project.pbxproj b/Firestore/Example/Firestore.xcodeproj/project.pbxproj index d90023b76d6..7b6e8450bf1 100644 --- a/Firestore/Example/Firestore.xcodeproj/project.pbxproj +++ b/Firestore/Example/Firestore.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 00A5761CD97E26A0EF4D47ED /* Validation_BloomFilterTest_MD5_5000_0001_membership_test_result.json in Resources */ = {isa = PBXBuildFile; fileRef = C8582DFD74E8060C7072104B /* Validation_BloomFilterTest_MD5_5000_0001_membership_test_result.json */; }; 00B7AFE2A7C158DD685EB5EE /* FIRCollectionReferenceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E045202154AA00B64F25 /* FIRCollectionReferenceTests.mm */; }; 00F1CB487E8E0DA48F2E8FEC /* message_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE37875365497FFA8687B745 /* message_test.cc */; }; + 00F49125748D47336BCDFB69 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; 0131DEDEF2C3CCAB2AB918A5 /* nanopb_util_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F5B6C1399F92FD60F2C582B /* nanopb_util_test.cc */; }; 01C66732ECCB83AB1D896026 /* bundle.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = A366F6AE1A5A77548485C091 /* bundle.pb.cc */; }; 01CF72FBF97CEB0AEFD9FAFE /* leveldb_document_overlay_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AE89CFF09C6804573841397F /* leveldb_document_overlay_cache_test.cc */; }; @@ -50,6 +51,7 @@ 06E0914D76667F1345EC17F5 /* Validation_BloomFilterTest_MD5_1_0001_membership_test_result.json in Resources */ = {isa = PBXBuildFile; fileRef = C939D1789E38C09F9A0C1157 /* Validation_BloomFilterTest_MD5_1_0001_membership_test_result.json */; }; 070B9CCDD759E66E6E10CC68 /* Validation_BloomFilterTest_MD5_50000_0001_bloom_filter_proto.json in Resources */ = {isa = PBXBuildFile; fileRef = A5D9044B72061CAF284BC9E4 /* Validation_BloomFilterTest_MD5_50000_0001_bloom_filter_proto.json */; }; 072D805A94E767DE4D371881 /* FSTSyncEngineTestDriver.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E02E20213FFC00B64F25 /* FSTSyncEngineTestDriver.mm */; }; + 0761CA9FBEDE1DF43D959252 /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; 076465DFEEEAA4CAF5A0595A /* leveldb_overlay_migration_manager_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D8A6D52723B1BABE1B7B8D8F /* leveldb_overlay_migration_manager_test.cc */; }; 077292C9797D97D3851F15CE /* leveldb_snappy_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D9D94300B9C02F7069523C00 /* leveldb_snappy_test.cc */; }; 0794FACCB1C0C4881A76C28D /* value_util_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 40F9D09063A07F710811A84F /* value_util_test.cc */; }; @@ -110,7 +112,9 @@ 0F99BB63CE5B3CFE35F9027E /* event_manager_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F57521E161450FAF89075ED /* event_manager_test.cc */; }; 0FA4D5601BE9F0CB5EC2882C /* local_serializer_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F8043813A5D16963EC02B182 /* local_serializer_test.cc */; }; 0FBDD5991E8F6CD5F8542474 /* latlng.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 618BBE9220B89AAC00B5BCE7 /* latlng.pb.cc */; }; + 0FC27212D6211ECC3D1DD2A1 /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 10120B9B650091B49D3CF57B /* grpc_stream_tester.cc in Sources */ = {isa = PBXBuildFile; fileRef = 87553338E42B8ECA05BA987E /* grpc_stream_tester.cc */; }; + 101393F60336924F64966C74 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; 1029F0461945A444FCB523B3 /* leveldb_local_store_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5FF903AEFA7A3284660FA4C5 /* leveldb_local_store_test.cc */; }; 10B69419AC04F157D855FED7 /* leveldb_document_overlay_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AE89CFF09C6804573841397F /* leveldb_document_overlay_cache_test.cc */; }; 1115DB1F1DCE93B63E03BA8C /* comparison_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 548DB928200D59F600E00ABC /* comparison_test.cc */; }; @@ -148,6 +152,7 @@ 15576E9A23A1C6678D5D7DE1 /* bloom_filter.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1E0C7C0DCD2790019E66D8CC /* bloom_filter.pb.cc */; }; 155B7B54FFC72C14530BC4D4 /* FSTTestingHooks.mm in Sources */ = {isa = PBXBuildFile; fileRef = D85AC18C55650ED230A71B82 /* FSTTestingHooks.mm */; }; 156429A2993B86A905A42D96 /* aggregation_result.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = D872D754B8AD88E28AF28B28 /* aggregation_result.pb.cc */; }; + 15A0A6FD290362B42B8DC93B /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 15A5DEC8430E71D64424CBFD /* target_index_matcher_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 63136A2371C0C013EC7A540C /* target_index_matcher_test.cc */; }; 15A5F95DA733FD89A1E4147D /* limit_spec_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 54DA129F1F315EE100DD57A1 /* limit_spec_test.json */; }; 15BF63DFF3A7E9A5376C4233 /* transform_operation_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 33607A3AE91548BD219EC9C6 /* transform_operation_test.cc */; }; @@ -274,6 +279,7 @@ 27E46C94AAB087C80A97FF7F /* FIRServerTimestampTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E06E202154D600B64F25 /* FIRServerTimestampTests.mm */; }; 280A282BE9AF4DCF4E855EAB /* filesystem_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F51859B394D01C0C507282F1 /* filesystem_test.cc */; }; 2836CD14F6F0EA3B184E325E /* schedule_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B0B005A79E765AF02793DCE /* schedule_test.cc */; }; + 2839CB9BF3250576F5044461 /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 284A5280F868B2B4B5A1C848 /* leveldb_target_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = E76F0CDF28E5FA62D21DE648 /* leveldb_target_cache_test.cc */; }; 28691225046DF9DF181B3350 /* ordered_code_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0473AFFF5567E667A125347B /* ordered_code_benchmark.cc */; }; 28E4B4A53A739AE2C9CF4159 /* FIRDocumentSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04B202154AA00B64F25 /* FIRDocumentSnapshotTests.mm */; }; @@ -371,6 +377,7 @@ 392966346DA5EB3165E16A22 /* bundle_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F7FC06E0A47D393DE1759AE1 /* bundle_cache_test.cc */; }; 392F527F144BADDAC69C5485 /* string_format_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54131E9620ADE678001DF3FF /* string_format_test.cc */; }; 394259BB091E1DB5994B91A2 /* bundle.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = A366F6AE1A5A77548485C091 /* bundle.pb.cc */; }; + 39790AC7E71BC06D48144BED /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; 3987A3E8534BAA496D966735 /* memory_index_manager_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = DB5A1E760451189DA36028B3 /* memory_index_manager_test.cc */; }; 39CDC9EC5FD2E891D6D49151 /* secure_random_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54740A531FC913E500713A1A /* secure_random_test.cc */; }; 3A307F319553A977258BB3D6 /* view_snapshot_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = CC572A9168BBEF7B83E4BBC5 /* view_snapshot_test.cc */; }; @@ -389,6 +396,8 @@ 3BA4EEA6153B3833F86B8104 /* writer_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = BC3C788D290A935C353CEAA1 /* writer_test.cc */; }; 3BAFCABA851AE1865D904323 /* to_string_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B696858D2214B53900271095 /* to_string_test.cc */; }; 3C5D441E7D5C140F0FB14D91 /* bloom_filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = A2E6F09AD1EE0A6A452E9A08 /* bloom_filter_test.cc */; }; + 3C9DEC46FE7B3995A4EA629C /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; + 3CCABD7BB5ED39DF1140B5F0 /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 3CFFA6F016231446367E3A69 /* listen_spec_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 54DA12A01F315EE100DD57A1 /* listen_spec_test.json */; }; 3D22F56C0DE7C7256C75DC06 /* tree_sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 549CCA4D20A36DBB00BCEB75 /* tree_sorted_map_test.cc */; }; 3D9619906F09108E34FF0C95 /* FSTSmokeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E07C202154EB00B64F25 /* FSTSmokeTests.mm */; }; @@ -679,6 +688,7 @@ 5DA343D28AE05B0B2FE9FFB3 /* tree_sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 549CCA4D20A36DBB00BCEB75 /* tree_sorted_map_test.cc */; }; 5DA741B0B90DB8DAB0AAE53C /* query_engine_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8A853940305237AFDA8050B /* query_engine_test.cc */; }; 5DDEC1A08F13226271FE636E /* resource_path_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B686F2B02024FFD70028D6BE /* resource_path_test.cc */; }; + 5DE8F28A95F7CBD2B699D470 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; 5E53122E4214FC4EA3B3DC1E /* resource.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1C3F7302BF4AE6CBC00ECDD0 /* resource.pb.cc */; }; 5E5B3B8B3A41C8EB70035A6B /* FSTTransactionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E07B202154EB00B64F25 /* FSTTransactionTests.mm */; }; 5E6F9184B271F6D5312412FF /* mutation_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = C8522DE226C467C54E6788D8 /* mutation_test.cc */; }; @@ -688,6 +698,7 @@ 5ECE040F87E9FCD0A5D215DB /* pretty_printing_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB323F9553050F4F6490F9FF /* pretty_printing_test.cc */; }; 5EDF0D63EAD6A65D4F8CDF45 /* schedule_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B0B005A79E765AF02793DCE /* schedule_test.cc */; }; 5EE21E86159A1911E9503BC1 /* transform_operation_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 33607A3AE91548BD219EC9C6 /* transform_operation_test.cc */; }; + 5EE3552E9EFB45791F83CBED /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 5EFBAD082CB0F86CD0711979 /* string_apple_test.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0EE5300F8233D14025EF0456 /* string_apple_test.mm */; }; 5F05A801B1EA44BC1264E55A /* FIRTypeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E071202154D600B64F25 /* FIRTypeTests.mm */; }; 5F096E8A16A3FAC824E194D1 /* FIRDocumentSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04B202154AA00B64F25 /* FIRDocumentSnapshotTests.mm */; }; @@ -798,6 +809,7 @@ 6E10507432E1D7AE658D16BD /* FSTSpecTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E03020213FFC00B64F25 /* FSTSpecTests.mm */; }; 6E4854B19B120C6F0F8192CC /* FSTAPIHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04E202154AA00B64F25 /* FSTAPIHelpers.mm */; }; 6E59498D20F55BA800ECD9A5 /* FuzzingResources in Resources */ = {isa = PBXBuildFile; fileRef = 6ED6DEA120F5502700FC6076 /* FuzzingResources */; }; + 6E6B8B8D61426E20495D9DF5 /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; 6E7603BC1D8011A5D6F62072 /* credentials_provider_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2F4FA4576525144C5069A7A5 /* credentials_provider_test.cc */; }; 6E8302E021022309003E1EA3 /* FSTFuzzTestFieldPath.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6E8302DF21022309003E1EA3 /* FSTFuzzTestFieldPath.mm */; }; 6E8CD8F545C8EDA84918977C /* index.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 395E8B07639E69290A929695 /* index.pb.cc */; }; @@ -956,6 +968,7 @@ 86E6FC2B7657C35B342E1436 /* sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 549CCA4E20A36DBB00BCEB75 /* sorted_map_test.cc */; }; 8705C4856498F66E471A0997 /* FIRWriteBatchTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E06F202154D600B64F25 /* FIRWriteBatchTests.mm */; }; 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; + 8778C1711059598070F86D3C /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 87B5972F1C67CB8D53ADA024 /* object_value_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 214877F52A705012D6720CA0 /* object_value_test.cc */; }; 87B5AC3EBF0E83166B142FA4 /* string_apple_benchmark.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4C73C0CC6F62A90D8573F383 /* string_apple_benchmark.mm */; }; 881E55152AB34465412F8542 /* FSTAPIHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04E202154AA00B64F25 /* FSTAPIHelpers.mm */; }; @@ -1234,9 +1247,11 @@ B9706A5CD29195A613CF4147 /* bundle_reader_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6ECAF7DE28A19C69DF386D88 /* bundle_reader_test.cc */; }; B99452AB7E16B72D1C01FBBC /* datastore_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3167BD972EFF8EC636530E59 /* datastore_test.cc */; }; B998971CE6D0D1DD2AD9250A /* Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json in Resources */ = {isa = PBXBuildFile; fileRef = 5B96CC29E9946508F022859C /* Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json */; }; + B9D4DA59E3ADFA44669E4514 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; BA0BB02821F1949783C8AA50 /* FIRCollectionReferenceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E045202154AA00B64F25 /* FIRCollectionReferenceTests.mm */; }; BA1C5EAE87393D8E60F5AE6D /* fake_target_metadata_provider.cc in Sources */ = {isa = PBXBuildFile; fileRef = 71140E5D09C6E76F7C71B2FC /* fake_target_metadata_provider.cc */; }; BA3C0BA8082A6FB2546E47AC /* CodableTimestampTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B65C996438B84DBC7616640 /* CodableTimestampTests.swift */; }; + BA630BD416C72344416BF7D9 /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; BA9A65BD6D993B2801A3C768 /* grpc_connection_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6D9649021544D4F00EB9CFB /* grpc_connection_test.cc */; }; BAB43C839445782040657239 /* executor_std_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6FB4687208F9B9100554BA2 /* executor_std_test.cc */; }; BACBBF4AF2F5455673AEAB35 /* leveldb_migrations_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = EF83ACD5E1E9F25845A9ACED /* leveldb_migrations_test.cc */; }; @@ -1298,6 +1313,7 @@ C4548D8C790387C8E64F0FC4 /* leveldb_snappy_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D9D94300B9C02F7069523C00 /* leveldb_snappy_test.cc */; }; C482E724F4B10968417C3F78 /* Pods_Firestore_FuzzTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B79CA87A1A01FC5329031C9B /* Pods_Firestore_FuzzTests_iOS.framework */; }; C4C7A8D11DC394EF81B7B1FA /* filesystem_testing.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA02DA2FCD0001CFC6EB08DA /* filesystem_testing.cc */; }; + C4D430E12F46F05416A66E0A /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; C524026444E83EEBC1773650 /* objc_type_traits_apple_test.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2A0CF41BA5AED6049B0BEB2C /* objc_type_traits_apple_test.mm */; }; C5655568EC2A9F6B5E6F9141 /* firestore.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 544129D421C2DDC800EFB9CC /* firestore.pb.cc */; }; C57B15CADD8C3E806B154C19 /* task_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 899FC22684B0F7BEEAE13527 /* task_test.cc */; }; @@ -1336,6 +1352,7 @@ CCE596E8654A4D2EEA75C219 /* index_backfiller_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F50E872B3F117A674DA8E94 /* index_backfiller_test.cc */; }; CD1E2F356FC71D7E74FCD26C /* leveldb_remote_document_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0840319686A223CC4AD3FAB1 /* leveldb_remote_document_cache_test.cc */; }; CD226D868CEFA9D557EF33A1 /* query_listener_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7C3F995E040E9E9C5E8514BB /* query_listener_test.cc */; }; + CD76A9EBD2E7D9E9E35A04F7 /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; CD78EEAA1CD36BE691CA3427 /* hashing_test_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = B69CF3F02227386500B281C8 /* hashing_test_apple.mm */; }; CDB5816537AB1B209C2B72A4 /* user_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = CCC9BD953F121B9E29F9AA42 /* user_test.cc */; }; CE2962775B42BDEEE8108567 /* leveldb_lru_garbage_collector_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B629525F7A1AAC1AB765C74F /* leveldb_lru_garbage_collector_test.cc */; }; @@ -1604,6 +1621,7 @@ FB3D9E01547436163C456A3C /* message_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE37875365497FFA8687B745 /* message_test.cc */; }; FBBB13329D3B5827C21AE7AB /* reference_set_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 132E32997D781B896672D30A /* reference_set_test.cc */; }; FC1D22B6EC4E5F089AE39B8C /* memory_target_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2286F308EFB0534B1BDE05B9 /* memory_target_cache_test.cc */; }; + FC6C9D1A8B24A5C9507272F7 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; FCA48FB54FC50BFDFDA672CD /* array_sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54EB764C202277B30088B8F3 /* array_sorted_map_test.cc */; }; FCF8E7F5268F6842C07B69CF /* write.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 544129D921C2DDC800EFB9CC /* write.pb.cc */; }; FD365D6DFE9511D3BA2C74DF /* hard_assert_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 444B7AB3F5A2929070CB1363 /* hard_assert_test.cc */; }; @@ -1746,6 +1764,7 @@ 4334F87873015E3763954578 /* status_testing.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = status_testing.h; sourceTree = ""; }; 4375BDCDBCA9938C7F086730 /* Validation_BloomFilterTest_MD5_5000_1_bloom_filter_proto.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_5000_1_bloom_filter_proto.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_5000_1_bloom_filter_proto.json; sourceTree = ""; }; 444B7AB3F5A2929070CB1363 /* hard_assert_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = hard_assert_test.cc; sourceTree = ""; }; + 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; path = globals_cache_test.cc; sourceTree = ""; }; 478DC75A0DCA6249A616DD30 /* Validation_BloomFilterTest_MD5_500_0001_membership_test_result.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_500_0001_membership_test_result.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_500_0001_membership_test_result.json; sourceTree = ""; }; 48D0915834C3D234E5A875A9 /* grpc_stream_tester.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = grpc_stream_tester.h; sourceTree = ""; }; 4B3E4A77493524333133C5DC /* Validation_BloomFilterTest_MD5_50000_1_bloom_filter_proto.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_50000_1_bloom_filter_proto.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_50000_1_bloom_filter_proto.json; sourceTree = ""; }; @@ -1863,6 +1882,7 @@ 5B5414D28802BC76FDADABD6 /* stream_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = stream_test.cc; sourceTree = ""; }; 5B96CC29E9946508F022859C /* Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json; sourceTree = ""; }; 5C68EE4CB94C0DD6E333F546 /* Validation_BloomFilterTest_MD5_1_01_membership_test_result.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_1_01_membership_test_result.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_1_01_membership_test_result.json; sourceTree = ""; }; + 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; path = memory_globals_cache_test.cc; sourceTree = ""; }; 5C7942B6244F4C416B11B86C /* leveldb_mutation_queue_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = leveldb_mutation_queue_test.cc; sourceTree = ""; }; 5CAE131920FFFED600BE9A4A /* Firestore_Benchmarks_iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Firestore_Benchmarks_iOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 5CAE131D20FFFED600BE9A4A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -1974,6 +1994,7 @@ 9B0B005A79E765AF02793DCE /* schedule_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = schedule_test.cc; sourceTree = ""; }; 9C1AFCC9E616EC33D6E169CF /* recovery_spec_test.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; path = recovery_spec_test.json; sourceTree = ""; }; 9CFD366B783AE27B9E79EE7A /* string_format_apple_test.mm */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.objcpp; path = string_format_apple_test.mm; sourceTree = ""; }; + 9E60C06991E3D28A0F70DD8D /* globals_cache_test.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = globals_cache_test.h; sourceTree = ""; }; A002425BC4FC4E805F4175B6 /* testing_hooks_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = testing_hooks_test.cc; sourceTree = ""; }; A082AFDD981B07B5AD78FDE8 /* token_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; name = token_test.cc; path = credentials/token_test.cc; sourceTree = ""; }; A20BAA3D2F994384279727EC /* md5_testing.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = md5_testing.h; sourceTree = ""; }; @@ -2105,6 +2126,7 @@ F848C41C03A25C42AD5A4BC2 /* target_cache_test.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = target_cache_test.h; sourceTree = ""; }; F869D85E900E5AF6CD02E2FC /* firebase_auth_credentials_provider_test.mm */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.objcpp; name = firebase_auth_credentials_provider_test.mm; path = credentials/firebase_auth_credentials_provider_test.mm; sourceTree = ""; }; FA2E9952BA2B299C1156C43C /* Pods-Firestore_Benchmarks_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Benchmarks_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Benchmarks_iOS/Pods-Firestore_Benchmarks_iOS.debug.xcconfig"; sourceTree = ""; }; + FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; path = leveldb_globals_cache_test.cc; sourceTree = ""; }; FC738525340E594EBFAB121E /* Pods-Firestore_Example_tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Example_tvOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Example_tvOS/Pods-Firestore_Example_tvOS.release.xcconfig"; sourceTree = ""; }; FF73B39D04D1760190E6B84A /* FIRQueryUnitTests.mm */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.objcpp; path = FIRQueryUnitTests.mm; sourceTree = ""; }; FFCA39825D9678A03D1845D0 /* document_overlay_cache_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = document_overlay_cache_test.cc; sourceTree = ""; }; @@ -2448,11 +2470,14 @@ 75E24C5CD7BC423D48713100 /* counting_query_engine.h */, FFCA39825D9678A03D1845D0 /* document_overlay_cache_test.cc */, DF445D5201750281F1817387 /* document_overlay_cache_test.h */, + 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */, + 9E60C06991E3D28A0F70DD8D /* globals_cache_test.h */, 1F50E872B3F117A674DA8E94 /* index_backfiller_test.cc */, AE4A9E38D65688EE000EE2A1 /* index_manager_test.cc */, 73F1F73A2210F3D800E1F692 /* index_manager_test.h */, 8E9CD82E60893DDD7757B798 /* leveldb_bundle_cache_test.cc */, AE89CFF09C6804573841397F /* leveldb_document_overlay_cache_test.cc */, + FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */, 166CE73C03AB4366AAC5201C /* leveldb_index_manager_test.cc */, 54995F6E205B6E12004EFFA0 /* leveldb_key_test.cc */, 5FF903AEFA7A3284660FA4C5 /* leveldb_local_store_test.cc */, @@ -2474,6 +2499,7 @@ CB7B2D4691C380DE3EB59038 /* lru_garbage_collector_test.h */, AB4AB1388538CD3CB19EB028 /* memory_bundle_cache_test.cc */, 29D9C76922DAC6F710BC1EF4 /* memory_document_overlay_cache_test.cc */, + 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */, DB5A1E760451189DA36028B3 /* memory_index_manager_test.cc */, F6CA0C5638AB6627CB5B4CF4 /* memory_local_store_test.cc */, 9765D47FA12FA283F4EFAD02 /* memory_lru_garbage_collector_test.cc */, @@ -4197,6 +4223,7 @@ 9B9BFC16E26BDE4AE0CDFF4B /* firebase_auth_credentials_provider_test.mm in Sources */, C5655568EC2A9F6B5E6F9141 /* firestore.pb.cc in Sources */, B8062EBDB8E5B680E46A6DD1 /* geo_point_test.cc in Sources */, + B9D4DA59E3ADFA44669E4514 /* globals_cache_test.cc in Sources */, 056542AD1D0F78E29E22EFA9 /* grpc_connection_test.cc in Sources */, 4D98894EB5B3D778F5628456 /* grpc_stream_test.cc in Sources */, 0A4E1B5E3E853763AE6ED7AE /* grpc_stream_tester.cc in Sources */, @@ -4213,6 +4240,7 @@ 49C04B97AB282FFA82FD98CD /* latlng.pb.cc in Sources */, 292BCC76AF1B916752764A8F /* leveldb_bundle_cache_test.cc in Sources */, 095A878BB33211AB52BFAD9F /* leveldb_document_overlay_cache_test.cc in Sources */, + 15A0A6FD290362B42B8DC93B /* leveldb_globals_cache_test.cc in Sources */, 8B3EB33933D11CF897EAF4C3 /* leveldb_index_manager_test.cc in Sources */, 568EC1C0F68A7B95E57C8C6C /* leveldb_key_test.cc in Sources */, 843EE932AA9A8F43721F189E /* leveldb_local_store_test.cc in Sources */, @@ -4238,6 +4266,7 @@ FE20E696E014CDCE918E91D6 /* md5_testing.cc in Sources */, FA43BA0195DA90CE29B29D36 /* memory_bundle_cache_test.cc in Sources */, 8F2055702DB5EE8DA4BACD7C /* memory_document_overlay_cache_test.cc in Sources */, + 0761CA9FBEDE1DF43D959252 /* memory_globals_cache_test.cc in Sources */, CFF1EBC60A00BA5109893C6E /* memory_index_manager_test.cc in Sources */, 49774EBBC8496FE1E43AEE29 /* memory_local_store_test.cc in Sources */, 66D9F8E8A65F97F436B1EE5E /* memory_lru_garbage_collector_test.cc in Sources */, @@ -4415,6 +4444,7 @@ 0E17927CE45F5E3FC6691E24 /* firebase_auth_credentials_provider_test.mm in Sources */, 8683BBC3AC7B01937606A83B /* firestore.pb.cc in Sources */, F7718C43D3A8FCCDB4BB0071 /* geo_point_test.cc in Sources */, + 101393F60336924F64966C74 /* globals_cache_test.cc in Sources */, BA9A65BD6D993B2801A3C768 /* grpc_connection_test.cc in Sources */, D6DE74259F5C0CCA010D6A0D /* grpc_stream_test.cc in Sources */, 336E415DD06E719F9C9E2A14 /* grpc_stream_tester.cc in Sources */, @@ -4431,6 +4461,7 @@ 0FBDD5991E8F6CD5F8542474 /* latlng.pb.cc in Sources */, 513D34C9964E8C60C5C2EE1C /* leveldb_bundle_cache_test.cc in Sources */, A6BDA28DBC85BC1BAB7061F4 /* leveldb_document_overlay_cache_test.cc in Sources */, + 3CCABD7BB5ED39DF1140B5F0 /* leveldb_globals_cache_test.cc in Sources */, A215078DBFBB5A4F4DADE8A9 /* leveldb_index_manager_test.cc in Sources */, B513F723728E923DFF34F60F /* leveldb_key_test.cc in Sources */, E63342115B1DA65DB6F2C59A /* leveldb_local_store_test.cc in Sources */, @@ -4456,6 +4487,7 @@ 169EDCF15637580BA79B61AD /* md5_testing.cc in Sources */, 9611A0FAA2E10A6B1C1AC2EA /* memory_bundle_cache_test.cc in Sources */, 75C6CECF607CA94F56260BAB /* memory_document_overlay_cache_test.cc in Sources */, + 3C9DEC46FE7B3995A4EA629C /* memory_globals_cache_test.cc in Sources */, 3987A3E8534BAA496D966735 /* memory_index_manager_test.cc in Sources */, B15D17049414E2F5AE72C9C6 /* memory_local_store_test.cc in Sources */, D4D8BA32ACC5C2B1B29711C0 /* memory_lru_garbage_collector_test.cc in Sources */, @@ -4657,6 +4689,7 @@ F7EE3CCC821975B71E834453 /* firebase_auth_credentials_provider_test.mm in Sources */, 8C602DAD4E8296AB5EFB962A /* firestore.pb.cc in Sources */, 6ABB82D43C0728EB095947AF /* geo_point_test.cc in Sources */, + 5DE8F28A95F7CBD2B699D470 /* globals_cache_test.cc in Sources */, D9DA467E7903412DC6AECDE4 /* grpc_connection_test.cc in Sources */, B7DD5FC63A78FF00E80332C0 /* grpc_stream_test.cc in Sources */, 10120B9B650091B49D3CF57B /* grpc_stream_tester.cc in Sources */, @@ -4673,6 +4706,7 @@ CBC891BEEC525F4D8F40A319 /* latlng.pb.cc in Sources */, 2E76BC76BBCE5FCDDCF5EEBE /* leveldb_bundle_cache_test.cc in Sources */, 6711E75A10EBA662341F5C9D /* leveldb_document_overlay_cache_test.cc in Sources */, + 2839CB9BF3250576F5044461 /* leveldb_globals_cache_test.cc in Sources */, A602E6C7C8B243BB767D251C /* leveldb_index_manager_test.cc in Sources */, 8AA7A1FCEE6EC309399978AD /* leveldb_key_test.cc in Sources */, 55E84644D385A70E607A0F91 /* leveldb_local_store_test.cc in Sources */, @@ -4698,6 +4732,7 @@ E2AC3BDAAFFF9A45C916708B /* md5_testing.cc in Sources */, FF6333B8BD9732C068157221 /* memory_bundle_cache_test.cc in Sources */, 5F6FD840AC2D729B50991CCB /* memory_document_overlay_cache_test.cc in Sources */, + 39790AC7E71BC06D48144BED /* memory_globals_cache_test.cc in Sources */, E6B825EE85BF20B88AF3E3CD /* memory_index_manager_test.cc in Sources */, 7ACA8D967438B5CD9DA4C884 /* memory_local_store_test.cc in Sources */, 444298A613D027AC67F7E977 /* memory_lru_garbage_collector_test.cc in Sources */, @@ -4899,6 +4934,7 @@ B6BEB7AF975FA31E169B7DD2 /* firebase_auth_credentials_provider_test.mm in Sources */, D756A1A63E626572EE8DF592 /* firestore.pb.cc in Sources */, 8B31F63673F3B5238DE95AFB /* geo_point_test.cc in Sources */, + FC6C9D1A8B24A5C9507272F7 /* globals_cache_test.cc in Sources */, 5958E3E3A0446A88B815CB70 /* grpc_connection_test.cc in Sources */, 0C18678CE7E355B17C34F2EE /* grpc_stream_test.cc in Sources */, B83A1416C3922E2F3EBA77FE /* grpc_stream_tester.cc in Sources */, @@ -4915,6 +4951,7 @@ 4173B61CB74EB4CD1D89EE68 /* latlng.pb.cc in Sources */, 1E8F5F37052AB0C087D69DF9 /* leveldb_bundle_cache_test.cc in Sources */, 10B69419AC04F157D855FED7 /* leveldb_document_overlay_cache_test.cc in Sources */, + 5EE3552E9EFB45791F83CBED /* leveldb_globals_cache_test.cc in Sources */, 839D8B502026706419FE09D6 /* leveldb_index_manager_test.cc in Sources */, A4AD189BDEF7A609953457A6 /* leveldb_key_test.cc in Sources */, 1029F0461945A444FCB523B3 /* leveldb_local_store_test.cc in Sources */, @@ -4940,6 +4977,7 @@ E72A77095FF6814267DF0F6D /* md5_testing.cc in Sources */, 94854FAEAEA75A1AC77A0515 /* memory_bundle_cache_test.cc in Sources */, 053C11420E49AE1A77E21C20 /* memory_document_overlay_cache_test.cc in Sources */, + BA630BD416C72344416BF7D9 /* memory_globals_cache_test.cc in Sources */, 4D8367018652104A8803E8DB /* memory_index_manager_test.cc in Sources */, 91AEFFEE35FBE15FEC42A1F4 /* memory_local_store_test.cc in Sources */, 3B23E21D5D7ACF54EBD8CF67 /* memory_lru_garbage_collector_test.cc in Sources */, @@ -5127,6 +5165,7 @@ C09BDBA73261578F9DA74CEE /* firebase_auth_credentials_provider_test.mm in Sources */, 544129DB21C2DDC800EFB9CC /* firestore.pb.cc in Sources */, AB7BAB342012B519001E0872 /* geo_point_test.cc in Sources */, + 00F49125748D47336BCDFB69 /* globals_cache_test.cc in Sources */, B6D9649121544D4F00EB9CFB /* grpc_connection_test.cc in Sources */, B6BBE43121262CF400C6A53E /* grpc_stream_test.cc in Sources */, 34202A37E0B762386967AF3D /* grpc_stream_tester.cc in Sources */, @@ -5143,6 +5182,7 @@ 618BBEAE20B89AAC00B5BCE7 /* latlng.pb.cc in Sources */, 0EDFC8A6593477E1D17CDD8F /* leveldb_bundle_cache_test.cc in Sources */, E962CA641FB1312638593131 /* leveldb_document_overlay_cache_test.cc in Sources */, + 8778C1711059598070F86D3C /* leveldb_globals_cache_test.cc in Sources */, B743F4E121E879EF34536A51 /* leveldb_index_manager_test.cc in Sources */, 54995F6F205B6E12004EFFA0 /* leveldb_key_test.cc in Sources */, 04887E378B39FB86A8A5B52B /* leveldb_local_store_test.cc in Sources */, @@ -5168,6 +5208,7 @@ 723BBD713478BB26CEFA5A7D /* md5_testing.cc in Sources */, A0E1C7F5C7093A498F65C5CF /* memory_bundle_cache_test.cc in Sources */, E56EEC9DAC455E2BE77D110A /* memory_document_overlay_cache_test.cc in Sources */, + 6E6B8B8D61426E20495D9DF5 /* memory_globals_cache_test.cc in Sources */, 3B47CC43DBA24434E215B8ED /* memory_index_manager_test.cc in Sources */, C6BF529243414C53DF5F1012 /* memory_local_store_test.cc in Sources */, 72B25B2D698E4746143D5B74 /* memory_lru_garbage_collector_test.cc in Sources */, @@ -5388,6 +5429,7 @@ 58693C153EC597BC25EE9648 /* firebase_auth_credentials_provider_test.mm in Sources */, 920B6ABF76FDB3547F1CCD84 /* firestore.pb.cc in Sources */, 5FE84472E5369DA866193C45 /* geo_point_test.cc in Sources */, + C4D430E12F46F05416A66E0A /* globals_cache_test.cc in Sources */, 0DDEE9FE08845BB7CA4607DE /* grpc_connection_test.cc in Sources */, 549CEDA0519BA5F2508794E1 /* grpc_stream_test.cc in Sources */, DE50F1D39D34F867BC750957 /* grpc_stream_tester.cc in Sources */, @@ -5404,6 +5446,7 @@ 23C04A637090E438461E4E70 /* latlng.pb.cc in Sources */, 77C459976DCF7503AEE18F7F /* leveldb_bundle_cache_test.cc in Sources */, 01CF72FBF97CEB0AEFD9FAFE /* leveldb_document_overlay_cache_test.cc in Sources */, + 0FC27212D6211ECC3D1DD2A1 /* leveldb_globals_cache_test.cc in Sources */, 2C5C612B26168BA9286290AE /* leveldb_index_manager_test.cc in Sources */, 7731E564468645A4A62E2A3C /* leveldb_key_test.cc in Sources */, 380A137B785A5A6991BEDF4B /* leveldb_local_store_test.cc in Sources */, @@ -5429,6 +5472,7 @@ 1DCDED1F94EBC7F72FDBFC98 /* md5_testing.cc in Sources */, 479A392EAB42453D49435D28 /* memory_bundle_cache_test.cc in Sources */, 5CEB0E83DA68652927D2CF07 /* memory_document_overlay_cache_test.cc in Sources */, + CD76A9EBD2E7D9E9E35A04F7 /* memory_globals_cache_test.cc in Sources */, 90FE088B8FD9EC06EEED1F39 /* memory_index_manager_test.cc in Sources */, 1CC56DCA513B98CE39A6ED45 /* memory_local_store_test.cc in Sources */, 264AAB492E24318C5EEB0649 /* memory_lru_garbage_collector_test.cc in Sources */, diff --git a/Firestore/core/src/local/globals_cache.h b/Firestore/core/src/local/globals_cache.h new file mode 100644 index 00000000000..78800470292 --- /dev/null +++ b/Firestore/core/src/local/globals_cache.h @@ -0,0 +1,57 @@ +/** + * @license + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_GLOBALS_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_GLOBALS_CACHE_H_ + +#include "Firestore/core/src/nanopb/byte_string.h" + +using firebase::firestore::nanopb::ByteString; + +namespace firebase { +namespace firestore { +namespace local { + +/** + * General purpose cache for global values. + * + * Global state that cuts across components should be saved here. Following are + * contained herein: + * + * `sessionToken` tracks server interaction across Listen and Write streams. + * This facilitates cache synchronization and invalidation. + */ +class GlobalsCache { + public: + virtual ~GlobalsCache() = default; + + /** + * Gets session token. + */ + virtual ByteString GetSessionToken() const = 0; + + /** + * Sets session token. + */ + virtual void SetSessionToken(const ByteString& session_token) = 0; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_GLOBALS_CACHE_H_ diff --git a/Firestore/core/src/local/leveldb_globals_cache.cc b/Firestore/core/src/local/leveldb_globals_cache.cc new file mode 100644 index 00000000000..366d0c811ea --- /dev/null +++ b/Firestore/core/src/local/leveldb_globals_cache.cc @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "Firestore/core/src/local/leveldb_globals_cache.h" +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/local/leveldb_persistence.h" + +namespace firebase { +namespace firestore { +namespace local { + +namespace { + +const char* kSessionToken = "session_token"; + +} + +LevelDbGlobalsCache::LevelDbGlobalsCache(LevelDbPersistence* db) + : db_(NOT_NULL(db)) { +} + +ByteString LevelDbGlobalsCache::GetSessionToken() const { + auto key = LevelDbGlobalKey::Key(kSessionToken); + + std::string encoded; + auto done = db_->current_transaction()->Get(key, &encoded); + + if (!done.ok()) { + return ByteString(); + } + + return ByteString(encoded); +} + +void LevelDbGlobalsCache::SetSessionToken(const ByteString& session_token) { + auto key = LevelDbGlobalKey::Key(kSessionToken); + db_->current_transaction()->Put(key, session_token.ToString()); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Firestore/core/src/local/leveldb_globals_cache.h b/Firestore/core/src/local/leveldb_globals_cache.h new file mode 100644 index 00000000000..4b41df5705e --- /dev/null +++ b/Firestore/core/src/local/leveldb_globals_cache.h @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_GLOBALS_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_GLOBALS_CACHE_H_ + +#include "Firestore/core/src/local/globals_cache.h" + +namespace firebase { +namespace firestore { +namespace local { + +class LevelDbPersistence; + +class LevelDbGlobalsCache : public GlobalsCache { + public: + /** Creates a new bundle cache in the given LevelDB. */ + explicit LevelDbGlobalsCache(LevelDbPersistence* db); + + /** + * Gets session token. + */ + ByteString GetSessionToken() const override; + + /** + * Sets session token. + */ + void SetSessionToken(const ByteString& session_token) override; + + private: + // The LevelDbGlobalsCache is owned by LevelDbPersistence. + LevelDbPersistence* db_ = nullptr; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_GLOBALS_CACHE_H_ diff --git a/Firestore/core/src/local/leveldb_key.cc b/Firestore/core/src/local/leveldb_key.cc index e8819650df4..fd0fa8dacd1 100644 --- a/Firestore/core/src/local/leveldb_key.cc +++ b/Firestore/core/src/local/leveldb_key.cc @@ -39,6 +39,7 @@ namespace local { namespace { const char* kVersionGlobalTable = "version"; +const char* kGlobalsTable = "globals"; const char* kMutationsTable = "mutation"; const char* kDocumentMutationsTable = "document_mutation"; const char* kMutationQueuesTable = "mutation_queue"; @@ -159,6 +160,11 @@ enum ComponentLabel { */ DataMigrationName = 25, + /** + * The name of a global. + */ + GlobalName = 26, + /** * A path segment describes just a single segment in a resource path. Path * segments that occur sequentially in a key represent successive segments in @@ -245,6 +251,10 @@ class Reader { return ReadLabeledString(ComponentLabel::BundleId); } + std::string ReadGlobalName() { + return ReadLabeledString(ComponentLabel::GlobalName); + } + std::string ReadQueryName() { return ReadLabeledString(ComponentLabel::QueryName); } @@ -718,6 +728,10 @@ class Writer { WriteLabeledString(ComponentLabel::TableName, table_name); } + void WriteGlobalName(absl::string_view global_name) { + WriteLabeledString(ComponentLabel::GlobalName, global_name); + } + void WriteBatchId(model::BatchId batch_id) { WriteLabeledInt32(ComponentLabel::BatchId, batch_id); } @@ -1206,6 +1220,28 @@ bool LevelDbRemoteDocumentReadTimeKey::Decode(absl::string_view key) { return reader.ok(); } +std::string LevelDbGlobalKey::KeyPrefix() { + Writer writer; + writer.WriteTableName(kGlobalsTable); + return writer.result(); +} + +std::string LevelDbGlobalKey::Key(absl::string_view global_name) { + Writer writer; + writer.WriteTableName(kGlobalsTable); + writer.WriteGlobalName(global_name); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbGlobalKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kGlobalsTable); + global_name_ = reader.ReadGlobalName(); + reader.ReadTerminator(); + return reader.ok(); +} + std::string LevelDbBundleKey::KeyPrefix() { Writer writer; writer.WriteTableName(kBundlesTable); diff --git a/Firestore/core/src/local/leveldb_key.h b/Firestore/core/src/local/leveldb_key.h index 51505b9c5c6..14ecd809ea2 100644 --- a/Firestore/core/src/local/leveldb_key.h +++ b/Firestore/core/src/local/leveldb_key.h @@ -768,6 +768,41 @@ class LevelDbNamedQueryKey { std::string name_; }; +/** + * A key in the globals table, storing the name of the global value. + */ +class LevelDbGlobalKey { + public: + /** + * Creates a key prefix that points just before the first key of the table. + */ + static std::string KeyPrefix(); + + /** + * Creates a key that points to the key for the given name of global value. + */ + static std::string Key(absl::string_view global_name); + + /** + * Decodes the given complete key, storing the decoded values in this + * instance. + * + * @return true if the key successfully decoded, false otherwise. If false is + * returned, this instance is in an undefined state until the next call to + * `Decode()`. + */ + ABSL_MUST_USE_RESULT + bool Decode(absl::string_view key); + + /** The name that serves as identifier for global value for this entry. */ + const std::string& global_name() const { + return global_name_; + } + + private: + std::string global_name_; +}; + /** * A key in the index_configuration table, storing the index definition proto, * and the collection (group) it applies to. diff --git a/Firestore/core/src/local/leveldb_persistence.cc b/Firestore/core/src/local/leveldb_persistence.cc index c5ce4c60c2d..9725e267356 100644 --- a/Firestore/core/src/local/leveldb_persistence.cc +++ b/Firestore/core/src/local/leveldb_persistence.cc @@ -126,6 +126,7 @@ LevelDbPersistence::LevelDbPersistence(std::unique_ptr db, reference_delegate_ = absl::make_unique(this, lru_params); bundle_cache_ = absl::make_unique(this, &serializer_); + globals_cache_ = absl::make_unique(this); // TODO(gsoltis): set up a leveldb transaction for these operations. target_cache_->Start(); @@ -250,6 +251,10 @@ LevelDbTargetCache* LevelDbPersistence::target_cache() { return target_cache_.get(); } +LevelDbGlobalsCache* LevelDbPersistence::globals_cache() { + return globals_cache_.get(); +} + LevelDbRemoteDocumentCache* LevelDbPersistence::remote_document_cache() { return document_cache_.get(); } diff --git a/Firestore/core/src/local/leveldb_persistence.h b/Firestore/core/src/local/leveldb_persistence.h index 1374d91a08e..5ca6491bccd 100644 --- a/Firestore/core/src/local/leveldb_persistence.h +++ b/Firestore/core/src/local/leveldb_persistence.h @@ -25,6 +25,7 @@ #include "Firestore/core/src/credentials/user.h" #include "Firestore/core/src/local/leveldb_bundle_cache.h" #include "Firestore/core/src/local/leveldb_document_overlay_cache.h" +#include "Firestore/core/src/local/leveldb_globals_cache.h" #include "Firestore/core/src/local/leveldb_index_manager.h" #include "Firestore/core/src/local/leveldb_lru_reference_delegate.h" #include "Firestore/core/src/local/leveldb_migrations.h" @@ -84,6 +85,8 @@ class LevelDbPersistence : public Persistence { LevelDbBundleCache* bundle_cache() override; + LevelDbGlobalsCache* globals_cache() override; + LevelDbDocumentOverlayCache* GetDocumentOverlayCache( const credentials::User& user) override; LevelDbOverlayMigrationManager* GetOverlayMigrationManager( @@ -154,6 +157,7 @@ class LevelDbPersistence : public Persistence { bool started_ = false; std::unique_ptr bundle_cache_; + std::unique_ptr globals_cache_; std::unordered_map> document_overlay_caches_; std::unordered_map + +#include "Firestore/core/src/local/globals_cache.h" + +namespace firebase { +namespace firestore { +namespace local { + +class MemoryGlobalsCache : public GlobalsCache { + public: + /** + * Gets session token. + */ + ByteString GetSessionToken() const override; + + /** + * Sets session token. + */ + void SetSessionToken(const ByteString& session_token) override; + + private: + ByteString session_token_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_GLOBALS_CACHE_H_ diff --git a/Firestore/core/src/local/memory_persistence.cc b/Firestore/core/src/local/memory_persistence.cc index 009036e1d8b..f1946661ba5 100644 --- a/Firestore/core/src/local/memory_persistence.cc +++ b/Firestore/core/src/local/memory_persistence.cc @@ -102,6 +102,10 @@ MemoryBundleCache* MemoryPersistence::bundle_cache() { return &bundle_cache_; } +MemoryGlobalsCache* MemoryPersistence::globals_cache() { + return &globals_cache_; +} + MemoryDocumentOverlayCache* MemoryPersistence::GetDocumentOverlayCache( const User& user) { auto iter = document_overlay_caches_.find(user); diff --git a/Firestore/core/src/local/memory_persistence.h b/Firestore/core/src/local/memory_persistence.h index 674577bbac2..bebadb86790 100644 --- a/Firestore/core/src/local/memory_persistence.h +++ b/Firestore/core/src/local/memory_persistence.h @@ -27,6 +27,7 @@ #include "Firestore/core/src/credentials/user.h" #include "Firestore/core/src/local/memory_bundle_cache.h" #include "Firestore/core/src/local/memory_document_overlay_cache.h" +#include "Firestore/core/src/local/memory_globals_cache.h" #include "Firestore/core/src/local/memory_index_manager.h" #include "Firestore/core/src/local/memory_mutation_queue.h" #include "Firestore/core/src/local/memory_remote_document_cache.h" @@ -90,6 +91,8 @@ class MemoryPersistence : public Persistence { MemoryBundleCache* bundle_cache() override; + MemoryGlobalsCache* globals_cache() override; + MemoryDocumentOverlayCache* GetDocumentOverlayCache( const credentials::User& user) override; @@ -138,6 +141,8 @@ class MemoryPersistence : public Persistence { MemoryBundleCache bundle_cache_; + MemoryGlobalsCache globals_cache_; + DocumentOverlayCaches document_overlay_caches_; MemoryOverlayMigrationManager overlay_migration_manager_; diff --git a/Firestore/core/src/local/persistence.h b/Firestore/core/src/local/persistence.h index b1f7ebde74f..3e184e4bac8 100644 --- a/Firestore/core/src/local/persistence.h +++ b/Firestore/core/src/local/persistence.h @@ -36,6 +36,7 @@ namespace local { class BundleCache; class DocumentOverlayCache; +class GlobalsCache; class IndexManager; class MutationQueue; class OverlayMigrationManager; @@ -86,6 +87,11 @@ class Persistence { /** Releases any resources held during eager shutdown. */ virtual void Shutdown() = 0; + /** + * Returns GlobalCache representing a general purpose cache for global values. + */ + virtual GlobalsCache* globals_cache() = 0; + /** * Returns a MutationQueue representing the persisted mutations for the given * user. diff --git a/Firestore/core/test/unit/local/globals_cache_test.cc b/Firestore/core/test/unit/local/globals_cache_test.cc new file mode 100644 index 00000000000..0945a3a7b35 --- /dev/null +++ b/Firestore/core/test/unit/local/globals_cache_test.cc @@ -0,0 +1,71 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/test/unit/local/globals_cache_test.h" + +#include "Firestore/core/src/local/globals_cache.h" +#include "Firestore/core/src/local/persistence.h" +#include "Firestore/core/test/unit/testutil/testutil.h" +#include "gtest/gtest.h" + +namespace firebase { +namespace firestore { + +using util::ComparisonResult; + +namespace local { + +GlobalsCacheTest::GlobalsCacheTest(std::unique_ptr persistence) + : persistence_(std::move(NOT_NULL(persistence))), + cache_(persistence_->globals_cache()) { +} + +GlobalsCacheTest::GlobalsCacheTest() : GlobalsCacheTest(GetParam()()) { +} + +namespace { + +TEST_P(GlobalsCacheTest, ReturnsEmptyBytestringWhenSessionTokenNotFound) { + persistence_->Run( + "test_returns_empty_bytestring_when_session_token_not_found", [&] { + auto expected = ByteString(); + EXPECT_EQ(cache_->GetSessionToken().CompareTo(expected), + ComparisonResult::Same); + }); +} + +TEST_P(GlobalsCacheTest, ReturnsSavedSessionToken) { + persistence_->Run("test_returns_saved_session_token", [&] { + auto expected = ByteString("magic"); + cache_->SetSessionToken(expected); + + EXPECT_EQ(cache_->GetSessionToken().CompareTo(expected), + ComparisonResult::Same); + + // Overwrite + expected = ByteString("science"); + cache_->SetSessionToken(expected); + + EXPECT_EQ(cache_->GetSessionToken().CompareTo(expected), + ComparisonResult::Same); + }); +} + +} // namespace + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Firestore/core/test/unit/local/globals_cache_test.h b/Firestore/core/test/unit/local/globals_cache_test.h new file mode 100644 index 00000000000..aad64844339 --- /dev/null +++ b/Firestore/core/test/unit/local/globals_cache_test.h @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_TEST_UNIT_LOCAL_GLOBALS_CACHE_TEST_H_ +#define FIRESTORE_CORE_TEST_UNIT_LOCAL_GLOBALS_CACHE_TEST_H_ + +#include + +#include "gtest/gtest.h" + +namespace firebase { +namespace firestore { +namespace local { + +class Persistence; +class GlobalsCache; + +using FactoryFunc = std::unique_ptr (*)(); + +/** + * These are tests for any implementation of the GlobalsCache interface. + * + * To test a specific implementation of GlobalsCache: + * + * - Write a persistence factory function + * - Call INSTANTIATE_TEST_SUITE_P(MyNewGlobalsCacheTest, + * GlobalsCacheTest, + * testing::Values(PersistenceFactory)); + */ +class GlobalsCacheTest : public testing::Test, + public testing::WithParamInterface { + public: + GlobalsCacheTest(); + explicit GlobalsCacheTest(std::unique_ptr persistence); + ~GlobalsCacheTest() = default; + + protected: + std::unique_ptr persistence_; + GlobalsCache* cache_ = nullptr; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_TEST_UNIT_LOCAL_GLOBALS_CACHE_TEST_H_ diff --git a/Firestore/core/test/unit/local/leveldb_globals_cache_test.cc b/Firestore/core/test/unit/local/leveldb_globals_cache_test.cc new file mode 100644 index 00000000000..4b6f11e5a48 --- /dev/null +++ b/Firestore/core/test/unit/local/leveldb_globals_cache_test.cc @@ -0,0 +1,38 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/test/unit/local/globals_cache_test.h" +#include "Firestore/core/test/unit/local/persistence_testing.h" + +namespace firebase { +namespace firestore { +namespace local { +namespace { + +std::unique_ptr PersistenceFactory() { + return LevelDbPersistenceForTesting(); +} + +} // namespace + +INSTANTIATE_TEST_SUITE_P(LevelDbGlobalsCacheTest, + GlobalsCacheTest, + testing::Values(PersistenceFactory)); + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Firestore/core/test/unit/local/memory_globals_cache_test.cc b/Firestore/core/test/unit/local/memory_globals_cache_test.cc new file mode 100644 index 00000000000..e3bcde58d96 --- /dev/null +++ b/Firestore/core/test/unit/local/memory_globals_cache_test.cc @@ -0,0 +1,38 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/memory_persistence.h" +#include "Firestore/core/test/unit/local/globals_cache_test.h" +#include "Firestore/core/test/unit/local/persistence_testing.h" + +namespace firebase { +namespace firestore { +namespace local { +namespace { + +std::unique_ptr PersistenceFactory() { + return MemoryPersistenceWithEagerGcForTesting(); +} + +} // namespace + +INSTANTIATE_TEST_SUITE_P(MemoryGloablsCacheTest, + GlobalsCacheTest, + testing::Values(PersistenceFactory)); + +} // namespace local +} // namespace firestore +} // namespace firebase From fb09f937affa36f4656e91ea2ab9f5d8659f5c33 Mon Sep 17 00:00:00 2001 From: Tom Andersen Date: Wed, 25 Sep 2024 11:17:37 -0400 Subject: [PATCH 11/13] Revert "SessionToken persistence implementation (#13684)" (#13719) --- Firestore/CHANGELOG.md | 1 - .../Firestore.xcodeproj/project.pbxproj | 44 ------------ Firestore/core/src/local/globals_cache.h | 57 --------------- .../core/src/local/leveldb_globals_cache.cc | 57 --------------- .../core/src/local/leveldb_globals_cache.h | 52 -------------- Firestore/core/src/local/leveldb_key.cc | 36 ---------- Firestore/core/src/local/leveldb_key.h | 35 --------- .../core/src/local/leveldb_persistence.cc | 5 -- .../core/src/local/leveldb_persistence.h | 4 -- .../core/src/local/memory_globals_cache.cc | 33 --------- .../core/src/local/memory_globals_cache.h | 49 ------------- .../core/src/local/memory_persistence.cc | 4 -- Firestore/core/src/local/memory_persistence.h | 5 -- Firestore/core/src/local/persistence.h | 6 -- .../test/unit/local/globals_cache_test.cc | 71 ------------------- .../core/test/unit/local/globals_cache_test.h | 59 --------------- .../unit/local/leveldb_globals_cache_test.cc | 38 ---------- .../unit/local/memory_globals_cache_test.cc | 38 ---------- 18 files changed, 594 deletions(-) delete mode 100644 Firestore/core/src/local/globals_cache.h delete mode 100644 Firestore/core/src/local/leveldb_globals_cache.cc delete mode 100644 Firestore/core/src/local/leveldb_globals_cache.h delete mode 100644 Firestore/core/src/local/memory_globals_cache.cc delete mode 100644 Firestore/core/src/local/memory_globals_cache.h delete mode 100644 Firestore/core/test/unit/local/globals_cache_test.cc delete mode 100644 Firestore/core/test/unit/local/globals_cache_test.h delete mode 100644 Firestore/core/test/unit/local/leveldb_globals_cache_test.cc delete mode 100644 Firestore/core/test/unit/local/memory_globals_cache_test.cc diff --git a/Firestore/CHANGELOG.md b/Firestore/CHANGELOG.md index dac0c7dbcdc..092e66027f8 100644 --- a/Firestore/CHANGELOG.md +++ b/Firestore/CHANGELOG.md @@ -1,6 +1,5 @@ # 11.3.0 - [changed] Improve efficiency of memory persistence when processing a large number of writes. (#13572) -- [changed] Prepare Firestore cache to support session token. # 11.2.0 - [fixed] Marked all public classes with only readonly properties as `Sendable` to address diff --git a/Firestore/Example/Firestore.xcodeproj/project.pbxproj b/Firestore/Example/Firestore.xcodeproj/project.pbxproj index 7b6e8450bf1..d90023b76d6 100644 --- a/Firestore/Example/Firestore.xcodeproj/project.pbxproj +++ b/Firestore/Example/Firestore.xcodeproj/project.pbxproj @@ -16,7 +16,6 @@ 00A5761CD97E26A0EF4D47ED /* Validation_BloomFilterTest_MD5_5000_0001_membership_test_result.json in Resources */ = {isa = PBXBuildFile; fileRef = C8582DFD74E8060C7072104B /* Validation_BloomFilterTest_MD5_5000_0001_membership_test_result.json */; }; 00B7AFE2A7C158DD685EB5EE /* FIRCollectionReferenceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E045202154AA00B64F25 /* FIRCollectionReferenceTests.mm */; }; 00F1CB487E8E0DA48F2E8FEC /* message_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE37875365497FFA8687B745 /* message_test.cc */; }; - 00F49125748D47336BCDFB69 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; 0131DEDEF2C3CCAB2AB918A5 /* nanopb_util_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F5B6C1399F92FD60F2C582B /* nanopb_util_test.cc */; }; 01C66732ECCB83AB1D896026 /* bundle.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = A366F6AE1A5A77548485C091 /* bundle.pb.cc */; }; 01CF72FBF97CEB0AEFD9FAFE /* leveldb_document_overlay_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AE89CFF09C6804573841397F /* leveldb_document_overlay_cache_test.cc */; }; @@ -51,7 +50,6 @@ 06E0914D76667F1345EC17F5 /* Validation_BloomFilterTest_MD5_1_0001_membership_test_result.json in Resources */ = {isa = PBXBuildFile; fileRef = C939D1789E38C09F9A0C1157 /* Validation_BloomFilterTest_MD5_1_0001_membership_test_result.json */; }; 070B9CCDD759E66E6E10CC68 /* Validation_BloomFilterTest_MD5_50000_0001_bloom_filter_proto.json in Resources */ = {isa = PBXBuildFile; fileRef = A5D9044B72061CAF284BC9E4 /* Validation_BloomFilterTest_MD5_50000_0001_bloom_filter_proto.json */; }; 072D805A94E767DE4D371881 /* FSTSyncEngineTestDriver.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E02E20213FFC00B64F25 /* FSTSyncEngineTestDriver.mm */; }; - 0761CA9FBEDE1DF43D959252 /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; 076465DFEEEAA4CAF5A0595A /* leveldb_overlay_migration_manager_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D8A6D52723B1BABE1B7B8D8F /* leveldb_overlay_migration_manager_test.cc */; }; 077292C9797D97D3851F15CE /* leveldb_snappy_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D9D94300B9C02F7069523C00 /* leveldb_snappy_test.cc */; }; 0794FACCB1C0C4881A76C28D /* value_util_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 40F9D09063A07F710811A84F /* value_util_test.cc */; }; @@ -112,9 +110,7 @@ 0F99BB63CE5B3CFE35F9027E /* event_manager_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6F57521E161450FAF89075ED /* event_manager_test.cc */; }; 0FA4D5601BE9F0CB5EC2882C /* local_serializer_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F8043813A5D16963EC02B182 /* local_serializer_test.cc */; }; 0FBDD5991E8F6CD5F8542474 /* latlng.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 618BBE9220B89AAC00B5BCE7 /* latlng.pb.cc */; }; - 0FC27212D6211ECC3D1DD2A1 /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 10120B9B650091B49D3CF57B /* grpc_stream_tester.cc in Sources */ = {isa = PBXBuildFile; fileRef = 87553338E42B8ECA05BA987E /* grpc_stream_tester.cc */; }; - 101393F60336924F64966C74 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; 1029F0461945A444FCB523B3 /* leveldb_local_store_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5FF903AEFA7A3284660FA4C5 /* leveldb_local_store_test.cc */; }; 10B69419AC04F157D855FED7 /* leveldb_document_overlay_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AE89CFF09C6804573841397F /* leveldb_document_overlay_cache_test.cc */; }; 1115DB1F1DCE93B63E03BA8C /* comparison_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 548DB928200D59F600E00ABC /* comparison_test.cc */; }; @@ -152,7 +148,6 @@ 15576E9A23A1C6678D5D7DE1 /* bloom_filter.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1E0C7C0DCD2790019E66D8CC /* bloom_filter.pb.cc */; }; 155B7B54FFC72C14530BC4D4 /* FSTTestingHooks.mm in Sources */ = {isa = PBXBuildFile; fileRef = D85AC18C55650ED230A71B82 /* FSTTestingHooks.mm */; }; 156429A2993B86A905A42D96 /* aggregation_result.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = D872D754B8AD88E28AF28B28 /* aggregation_result.pb.cc */; }; - 15A0A6FD290362B42B8DC93B /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 15A5DEC8430E71D64424CBFD /* target_index_matcher_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 63136A2371C0C013EC7A540C /* target_index_matcher_test.cc */; }; 15A5F95DA733FD89A1E4147D /* limit_spec_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 54DA129F1F315EE100DD57A1 /* limit_spec_test.json */; }; 15BF63DFF3A7E9A5376C4233 /* transform_operation_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 33607A3AE91548BD219EC9C6 /* transform_operation_test.cc */; }; @@ -279,7 +274,6 @@ 27E46C94AAB087C80A97FF7F /* FIRServerTimestampTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E06E202154D600B64F25 /* FIRServerTimestampTests.mm */; }; 280A282BE9AF4DCF4E855EAB /* filesystem_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F51859B394D01C0C507282F1 /* filesystem_test.cc */; }; 2836CD14F6F0EA3B184E325E /* schedule_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B0B005A79E765AF02793DCE /* schedule_test.cc */; }; - 2839CB9BF3250576F5044461 /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 284A5280F868B2B4B5A1C848 /* leveldb_target_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = E76F0CDF28E5FA62D21DE648 /* leveldb_target_cache_test.cc */; }; 28691225046DF9DF181B3350 /* ordered_code_benchmark.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0473AFFF5567E667A125347B /* ordered_code_benchmark.cc */; }; 28E4B4A53A739AE2C9CF4159 /* FIRDocumentSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04B202154AA00B64F25 /* FIRDocumentSnapshotTests.mm */; }; @@ -377,7 +371,6 @@ 392966346DA5EB3165E16A22 /* bundle_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F7FC06E0A47D393DE1759AE1 /* bundle_cache_test.cc */; }; 392F527F144BADDAC69C5485 /* string_format_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54131E9620ADE678001DF3FF /* string_format_test.cc */; }; 394259BB091E1DB5994B91A2 /* bundle.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = A366F6AE1A5A77548485C091 /* bundle.pb.cc */; }; - 39790AC7E71BC06D48144BED /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; 3987A3E8534BAA496D966735 /* memory_index_manager_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = DB5A1E760451189DA36028B3 /* memory_index_manager_test.cc */; }; 39CDC9EC5FD2E891D6D49151 /* secure_random_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54740A531FC913E500713A1A /* secure_random_test.cc */; }; 3A307F319553A977258BB3D6 /* view_snapshot_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = CC572A9168BBEF7B83E4BBC5 /* view_snapshot_test.cc */; }; @@ -396,8 +389,6 @@ 3BA4EEA6153B3833F86B8104 /* writer_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = BC3C788D290A935C353CEAA1 /* writer_test.cc */; }; 3BAFCABA851AE1865D904323 /* to_string_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B696858D2214B53900271095 /* to_string_test.cc */; }; 3C5D441E7D5C140F0FB14D91 /* bloom_filter_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = A2E6F09AD1EE0A6A452E9A08 /* bloom_filter_test.cc */; }; - 3C9DEC46FE7B3995A4EA629C /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; - 3CCABD7BB5ED39DF1140B5F0 /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 3CFFA6F016231446367E3A69 /* listen_spec_test.json in Resources */ = {isa = PBXBuildFile; fileRef = 54DA12A01F315EE100DD57A1 /* listen_spec_test.json */; }; 3D22F56C0DE7C7256C75DC06 /* tree_sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 549CCA4D20A36DBB00BCEB75 /* tree_sorted_map_test.cc */; }; 3D9619906F09108E34FF0C95 /* FSTSmokeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E07C202154EB00B64F25 /* FSTSmokeTests.mm */; }; @@ -688,7 +679,6 @@ 5DA343D28AE05B0B2FE9FFB3 /* tree_sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 549CCA4D20A36DBB00BCEB75 /* tree_sorted_map_test.cc */; }; 5DA741B0B90DB8DAB0AAE53C /* query_engine_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B8A853940305237AFDA8050B /* query_engine_test.cc */; }; 5DDEC1A08F13226271FE636E /* resource_path_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B686F2B02024FFD70028D6BE /* resource_path_test.cc */; }; - 5DE8F28A95F7CBD2B699D470 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; 5E53122E4214FC4EA3B3DC1E /* resource.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1C3F7302BF4AE6CBC00ECDD0 /* resource.pb.cc */; }; 5E5B3B8B3A41C8EB70035A6B /* FSTTransactionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E07B202154EB00B64F25 /* FSTTransactionTests.mm */; }; 5E6F9184B271F6D5312412FF /* mutation_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = C8522DE226C467C54E6788D8 /* mutation_test.cc */; }; @@ -698,7 +688,6 @@ 5ECE040F87E9FCD0A5D215DB /* pretty_printing_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB323F9553050F4F6490F9FF /* pretty_printing_test.cc */; }; 5EDF0D63EAD6A65D4F8CDF45 /* schedule_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B0B005A79E765AF02793DCE /* schedule_test.cc */; }; 5EE21E86159A1911E9503BC1 /* transform_operation_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 33607A3AE91548BD219EC9C6 /* transform_operation_test.cc */; }; - 5EE3552E9EFB45791F83CBED /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 5EFBAD082CB0F86CD0711979 /* string_apple_test.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0EE5300F8233D14025EF0456 /* string_apple_test.mm */; }; 5F05A801B1EA44BC1264E55A /* FIRTypeTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E071202154D600B64F25 /* FIRTypeTests.mm */; }; 5F096E8A16A3FAC824E194D1 /* FIRDocumentSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04B202154AA00B64F25 /* FIRDocumentSnapshotTests.mm */; }; @@ -809,7 +798,6 @@ 6E10507432E1D7AE658D16BD /* FSTSpecTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E03020213FFC00B64F25 /* FSTSpecTests.mm */; }; 6E4854B19B120C6F0F8192CC /* FSTAPIHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04E202154AA00B64F25 /* FSTAPIHelpers.mm */; }; 6E59498D20F55BA800ECD9A5 /* FuzzingResources in Resources */ = {isa = PBXBuildFile; fileRef = 6ED6DEA120F5502700FC6076 /* FuzzingResources */; }; - 6E6B8B8D61426E20495D9DF5 /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; 6E7603BC1D8011A5D6F62072 /* credentials_provider_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2F4FA4576525144C5069A7A5 /* credentials_provider_test.cc */; }; 6E8302E021022309003E1EA3 /* FSTFuzzTestFieldPath.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6E8302DF21022309003E1EA3 /* FSTFuzzTestFieldPath.mm */; }; 6E8CD8F545C8EDA84918977C /* index.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 395E8B07639E69290A929695 /* index.pb.cc */; }; @@ -968,7 +956,6 @@ 86E6FC2B7657C35B342E1436 /* sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 549CCA4E20A36DBB00BCEB75 /* sorted_map_test.cc */; }; 8705C4856498F66E471A0997 /* FIRWriteBatchTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E06F202154D600B64F25 /* FIRWriteBatchTests.mm */; }; 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; - 8778C1711059598070F86D3C /* leveldb_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */; }; 87B5972F1C67CB8D53ADA024 /* object_value_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 214877F52A705012D6720CA0 /* object_value_test.cc */; }; 87B5AC3EBF0E83166B142FA4 /* string_apple_benchmark.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4C73C0CC6F62A90D8573F383 /* string_apple_benchmark.mm */; }; 881E55152AB34465412F8542 /* FSTAPIHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E04E202154AA00B64F25 /* FSTAPIHelpers.mm */; }; @@ -1247,11 +1234,9 @@ B9706A5CD29195A613CF4147 /* bundle_reader_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 6ECAF7DE28A19C69DF386D88 /* bundle_reader_test.cc */; }; B99452AB7E16B72D1C01FBBC /* datastore_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3167BD972EFF8EC636530E59 /* datastore_test.cc */; }; B998971CE6D0D1DD2AD9250A /* Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json in Resources */ = {isa = PBXBuildFile; fileRef = 5B96CC29E9946508F022859C /* Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json */; }; - B9D4DA59E3ADFA44669E4514 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; BA0BB02821F1949783C8AA50 /* FIRCollectionReferenceTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5492E045202154AA00B64F25 /* FIRCollectionReferenceTests.mm */; }; BA1C5EAE87393D8E60F5AE6D /* fake_target_metadata_provider.cc in Sources */ = {isa = PBXBuildFile; fileRef = 71140E5D09C6E76F7C71B2FC /* fake_target_metadata_provider.cc */; }; BA3C0BA8082A6FB2546E47AC /* CodableTimestampTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B65C996438B84DBC7616640 /* CodableTimestampTests.swift */; }; - BA630BD416C72344416BF7D9 /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; BA9A65BD6D993B2801A3C768 /* grpc_connection_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6D9649021544D4F00EB9CFB /* grpc_connection_test.cc */; }; BAB43C839445782040657239 /* executor_std_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6FB4687208F9B9100554BA2 /* executor_std_test.cc */; }; BACBBF4AF2F5455673AEAB35 /* leveldb_migrations_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = EF83ACD5E1E9F25845A9ACED /* leveldb_migrations_test.cc */; }; @@ -1313,7 +1298,6 @@ C4548D8C790387C8E64F0FC4 /* leveldb_snappy_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D9D94300B9C02F7069523C00 /* leveldb_snappy_test.cc */; }; C482E724F4B10968417C3F78 /* Pods_Firestore_FuzzTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B79CA87A1A01FC5329031C9B /* Pods_Firestore_FuzzTests_iOS.framework */; }; C4C7A8D11DC394EF81B7B1FA /* filesystem_testing.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA02DA2FCD0001CFC6EB08DA /* filesystem_testing.cc */; }; - C4D430E12F46F05416A66E0A /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; C524026444E83EEBC1773650 /* objc_type_traits_apple_test.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2A0CF41BA5AED6049B0BEB2C /* objc_type_traits_apple_test.mm */; }; C5655568EC2A9F6B5E6F9141 /* firestore.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 544129D421C2DDC800EFB9CC /* firestore.pb.cc */; }; C57B15CADD8C3E806B154C19 /* task_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 899FC22684B0F7BEEAE13527 /* task_test.cc */; }; @@ -1352,7 +1336,6 @@ CCE596E8654A4D2EEA75C219 /* index_backfiller_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F50E872B3F117A674DA8E94 /* index_backfiller_test.cc */; }; CD1E2F356FC71D7E74FCD26C /* leveldb_remote_document_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 0840319686A223CC4AD3FAB1 /* leveldb_remote_document_cache_test.cc */; }; CD226D868CEFA9D557EF33A1 /* query_listener_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7C3F995E040E9E9C5E8514BB /* query_listener_test.cc */; }; - CD76A9EBD2E7D9E9E35A04F7 /* memory_globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */; }; CD78EEAA1CD36BE691CA3427 /* hashing_test_apple.mm in Sources */ = {isa = PBXBuildFile; fileRef = B69CF3F02227386500B281C8 /* hashing_test_apple.mm */; }; CDB5816537AB1B209C2B72A4 /* user_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = CCC9BD953F121B9E29F9AA42 /* user_test.cc */; }; CE2962775B42BDEEE8108567 /* leveldb_lru_garbage_collector_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = B629525F7A1AAC1AB765C74F /* leveldb_lru_garbage_collector_test.cc */; }; @@ -1621,7 +1604,6 @@ FB3D9E01547436163C456A3C /* message_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE37875365497FFA8687B745 /* message_test.cc */; }; FBBB13329D3B5827C21AE7AB /* reference_set_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 132E32997D781B896672D30A /* reference_set_test.cc */; }; FC1D22B6EC4E5F089AE39B8C /* memory_target_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2286F308EFB0534B1BDE05B9 /* memory_target_cache_test.cc */; }; - FC6C9D1A8B24A5C9507272F7 /* globals_cache_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */; }; FCA48FB54FC50BFDFDA672CD /* array_sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54EB764C202277B30088B8F3 /* array_sorted_map_test.cc */; }; FCF8E7F5268F6842C07B69CF /* write.pb.cc in Sources */ = {isa = PBXBuildFile; fileRef = 544129D921C2DDC800EFB9CC /* write.pb.cc */; }; FD365D6DFE9511D3BA2C74DF /* hard_assert_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 444B7AB3F5A2929070CB1363 /* hard_assert_test.cc */; }; @@ -1764,7 +1746,6 @@ 4334F87873015E3763954578 /* status_testing.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = status_testing.h; sourceTree = ""; }; 4375BDCDBCA9938C7F086730 /* Validation_BloomFilterTest_MD5_5000_1_bloom_filter_proto.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_5000_1_bloom_filter_proto.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_5000_1_bloom_filter_proto.json; sourceTree = ""; }; 444B7AB3F5A2929070CB1363 /* hard_assert_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = hard_assert_test.cc; sourceTree = ""; }; - 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; path = globals_cache_test.cc; sourceTree = ""; }; 478DC75A0DCA6249A616DD30 /* Validation_BloomFilterTest_MD5_500_0001_membership_test_result.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_500_0001_membership_test_result.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_500_0001_membership_test_result.json; sourceTree = ""; }; 48D0915834C3D234E5A875A9 /* grpc_stream_tester.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = grpc_stream_tester.h; sourceTree = ""; }; 4B3E4A77493524333133C5DC /* Validation_BloomFilterTest_MD5_50000_1_bloom_filter_proto.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_50000_1_bloom_filter_proto.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_50000_1_bloom_filter_proto.json; sourceTree = ""; }; @@ -1882,7 +1863,6 @@ 5B5414D28802BC76FDADABD6 /* stream_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = stream_test.cc; sourceTree = ""; }; 5B96CC29E9946508F022859C /* Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_50000_0001_membership_test_result.json; sourceTree = ""; }; 5C68EE4CB94C0DD6E333F546 /* Validation_BloomFilterTest_MD5_1_01_membership_test_result.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; name = Validation_BloomFilterTest_MD5_1_01_membership_test_result.json; path = bloom_filter_golden_test_data/Validation_BloomFilterTest_MD5_1_01_membership_test_result.json; sourceTree = ""; }; - 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; path = memory_globals_cache_test.cc; sourceTree = ""; }; 5C7942B6244F4C416B11B86C /* leveldb_mutation_queue_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = leveldb_mutation_queue_test.cc; sourceTree = ""; }; 5CAE131920FFFED600BE9A4A /* Firestore_Benchmarks_iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Firestore_Benchmarks_iOS.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 5CAE131D20FFFED600BE9A4A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -1994,7 +1974,6 @@ 9B0B005A79E765AF02793DCE /* schedule_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = schedule_test.cc; sourceTree = ""; }; 9C1AFCC9E616EC33D6E169CF /* recovery_spec_test.json */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.json; path = recovery_spec_test.json; sourceTree = ""; }; 9CFD366B783AE27B9E79EE7A /* string_format_apple_test.mm */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.objcpp; path = string_format_apple_test.mm; sourceTree = ""; }; - 9E60C06991E3D28A0F70DD8D /* globals_cache_test.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = globals_cache_test.h; sourceTree = ""; }; A002425BC4FC4E805F4175B6 /* testing_hooks_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = testing_hooks_test.cc; sourceTree = ""; }; A082AFDD981B07B5AD78FDE8 /* token_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; name = token_test.cc; path = credentials/token_test.cc; sourceTree = ""; }; A20BAA3D2F994384279727EC /* md5_testing.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = md5_testing.h; sourceTree = ""; }; @@ -2126,7 +2105,6 @@ F848C41C03A25C42AD5A4BC2 /* target_cache_test.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = target_cache_test.h; sourceTree = ""; }; F869D85E900E5AF6CD02E2FC /* firebase_auth_credentials_provider_test.mm */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.objcpp; name = firebase_auth_credentials_provider_test.mm; path = credentials/firebase_auth_credentials_provider_test.mm; sourceTree = ""; }; FA2E9952BA2B299C1156C43C /* Pods-Firestore_Benchmarks_iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Benchmarks_iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Benchmarks_iOS/Pods-Firestore_Benchmarks_iOS.debug.xcconfig"; sourceTree = ""; }; - FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; path = leveldb_globals_cache_test.cc; sourceTree = ""; }; FC738525340E594EBFAB121E /* Pods-Firestore_Example_tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Firestore_Example_tvOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-Firestore_Example_tvOS/Pods-Firestore_Example_tvOS.release.xcconfig"; sourceTree = ""; }; FF73B39D04D1760190E6B84A /* FIRQueryUnitTests.mm */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.objcpp; path = FIRQueryUnitTests.mm; sourceTree = ""; }; FFCA39825D9678A03D1845D0 /* document_overlay_cache_test.cc */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.cpp.cpp; path = document_overlay_cache_test.cc; sourceTree = ""; }; @@ -2470,14 +2448,11 @@ 75E24C5CD7BC423D48713100 /* counting_query_engine.h */, FFCA39825D9678A03D1845D0 /* document_overlay_cache_test.cc */, DF445D5201750281F1817387 /* document_overlay_cache_test.h */, - 4564AD9C55EC39C080EB9476 /* globals_cache_test.cc */, - 9E60C06991E3D28A0F70DD8D /* globals_cache_test.h */, 1F50E872B3F117A674DA8E94 /* index_backfiller_test.cc */, AE4A9E38D65688EE000EE2A1 /* index_manager_test.cc */, 73F1F73A2210F3D800E1F692 /* index_manager_test.h */, 8E9CD82E60893DDD7757B798 /* leveldb_bundle_cache_test.cc */, AE89CFF09C6804573841397F /* leveldb_document_overlay_cache_test.cc */, - FC44D934D4A52C790659C8D6 /* leveldb_globals_cache_test.cc */, 166CE73C03AB4366AAC5201C /* leveldb_index_manager_test.cc */, 54995F6E205B6E12004EFFA0 /* leveldb_key_test.cc */, 5FF903AEFA7A3284660FA4C5 /* leveldb_local_store_test.cc */, @@ -2499,7 +2474,6 @@ CB7B2D4691C380DE3EB59038 /* lru_garbage_collector_test.h */, AB4AB1388538CD3CB19EB028 /* memory_bundle_cache_test.cc */, 29D9C76922DAC6F710BC1EF4 /* memory_document_overlay_cache_test.cc */, - 5C6DEA63FBDE19D841291723 /* memory_globals_cache_test.cc */, DB5A1E760451189DA36028B3 /* memory_index_manager_test.cc */, F6CA0C5638AB6627CB5B4CF4 /* memory_local_store_test.cc */, 9765D47FA12FA283F4EFAD02 /* memory_lru_garbage_collector_test.cc */, @@ -4223,7 +4197,6 @@ 9B9BFC16E26BDE4AE0CDFF4B /* firebase_auth_credentials_provider_test.mm in Sources */, C5655568EC2A9F6B5E6F9141 /* firestore.pb.cc in Sources */, B8062EBDB8E5B680E46A6DD1 /* geo_point_test.cc in Sources */, - B9D4DA59E3ADFA44669E4514 /* globals_cache_test.cc in Sources */, 056542AD1D0F78E29E22EFA9 /* grpc_connection_test.cc in Sources */, 4D98894EB5B3D778F5628456 /* grpc_stream_test.cc in Sources */, 0A4E1B5E3E853763AE6ED7AE /* grpc_stream_tester.cc in Sources */, @@ -4240,7 +4213,6 @@ 49C04B97AB282FFA82FD98CD /* latlng.pb.cc in Sources */, 292BCC76AF1B916752764A8F /* leveldb_bundle_cache_test.cc in Sources */, 095A878BB33211AB52BFAD9F /* leveldb_document_overlay_cache_test.cc in Sources */, - 15A0A6FD290362B42B8DC93B /* leveldb_globals_cache_test.cc in Sources */, 8B3EB33933D11CF897EAF4C3 /* leveldb_index_manager_test.cc in Sources */, 568EC1C0F68A7B95E57C8C6C /* leveldb_key_test.cc in Sources */, 843EE932AA9A8F43721F189E /* leveldb_local_store_test.cc in Sources */, @@ -4266,7 +4238,6 @@ FE20E696E014CDCE918E91D6 /* md5_testing.cc in Sources */, FA43BA0195DA90CE29B29D36 /* memory_bundle_cache_test.cc in Sources */, 8F2055702DB5EE8DA4BACD7C /* memory_document_overlay_cache_test.cc in Sources */, - 0761CA9FBEDE1DF43D959252 /* memory_globals_cache_test.cc in Sources */, CFF1EBC60A00BA5109893C6E /* memory_index_manager_test.cc in Sources */, 49774EBBC8496FE1E43AEE29 /* memory_local_store_test.cc in Sources */, 66D9F8E8A65F97F436B1EE5E /* memory_lru_garbage_collector_test.cc in Sources */, @@ -4444,7 +4415,6 @@ 0E17927CE45F5E3FC6691E24 /* firebase_auth_credentials_provider_test.mm in Sources */, 8683BBC3AC7B01937606A83B /* firestore.pb.cc in Sources */, F7718C43D3A8FCCDB4BB0071 /* geo_point_test.cc in Sources */, - 101393F60336924F64966C74 /* globals_cache_test.cc in Sources */, BA9A65BD6D993B2801A3C768 /* grpc_connection_test.cc in Sources */, D6DE74259F5C0CCA010D6A0D /* grpc_stream_test.cc in Sources */, 336E415DD06E719F9C9E2A14 /* grpc_stream_tester.cc in Sources */, @@ -4461,7 +4431,6 @@ 0FBDD5991E8F6CD5F8542474 /* latlng.pb.cc in Sources */, 513D34C9964E8C60C5C2EE1C /* leveldb_bundle_cache_test.cc in Sources */, A6BDA28DBC85BC1BAB7061F4 /* leveldb_document_overlay_cache_test.cc in Sources */, - 3CCABD7BB5ED39DF1140B5F0 /* leveldb_globals_cache_test.cc in Sources */, A215078DBFBB5A4F4DADE8A9 /* leveldb_index_manager_test.cc in Sources */, B513F723728E923DFF34F60F /* leveldb_key_test.cc in Sources */, E63342115B1DA65DB6F2C59A /* leveldb_local_store_test.cc in Sources */, @@ -4487,7 +4456,6 @@ 169EDCF15637580BA79B61AD /* md5_testing.cc in Sources */, 9611A0FAA2E10A6B1C1AC2EA /* memory_bundle_cache_test.cc in Sources */, 75C6CECF607CA94F56260BAB /* memory_document_overlay_cache_test.cc in Sources */, - 3C9DEC46FE7B3995A4EA629C /* memory_globals_cache_test.cc in Sources */, 3987A3E8534BAA496D966735 /* memory_index_manager_test.cc in Sources */, B15D17049414E2F5AE72C9C6 /* memory_local_store_test.cc in Sources */, D4D8BA32ACC5C2B1B29711C0 /* memory_lru_garbage_collector_test.cc in Sources */, @@ -4689,7 +4657,6 @@ F7EE3CCC821975B71E834453 /* firebase_auth_credentials_provider_test.mm in Sources */, 8C602DAD4E8296AB5EFB962A /* firestore.pb.cc in Sources */, 6ABB82D43C0728EB095947AF /* geo_point_test.cc in Sources */, - 5DE8F28A95F7CBD2B699D470 /* globals_cache_test.cc in Sources */, D9DA467E7903412DC6AECDE4 /* grpc_connection_test.cc in Sources */, B7DD5FC63A78FF00E80332C0 /* grpc_stream_test.cc in Sources */, 10120B9B650091B49D3CF57B /* grpc_stream_tester.cc in Sources */, @@ -4706,7 +4673,6 @@ CBC891BEEC525F4D8F40A319 /* latlng.pb.cc in Sources */, 2E76BC76BBCE5FCDDCF5EEBE /* leveldb_bundle_cache_test.cc in Sources */, 6711E75A10EBA662341F5C9D /* leveldb_document_overlay_cache_test.cc in Sources */, - 2839CB9BF3250576F5044461 /* leveldb_globals_cache_test.cc in Sources */, A602E6C7C8B243BB767D251C /* leveldb_index_manager_test.cc in Sources */, 8AA7A1FCEE6EC309399978AD /* leveldb_key_test.cc in Sources */, 55E84644D385A70E607A0F91 /* leveldb_local_store_test.cc in Sources */, @@ -4732,7 +4698,6 @@ E2AC3BDAAFFF9A45C916708B /* md5_testing.cc in Sources */, FF6333B8BD9732C068157221 /* memory_bundle_cache_test.cc in Sources */, 5F6FD840AC2D729B50991CCB /* memory_document_overlay_cache_test.cc in Sources */, - 39790AC7E71BC06D48144BED /* memory_globals_cache_test.cc in Sources */, E6B825EE85BF20B88AF3E3CD /* memory_index_manager_test.cc in Sources */, 7ACA8D967438B5CD9DA4C884 /* memory_local_store_test.cc in Sources */, 444298A613D027AC67F7E977 /* memory_lru_garbage_collector_test.cc in Sources */, @@ -4934,7 +4899,6 @@ B6BEB7AF975FA31E169B7DD2 /* firebase_auth_credentials_provider_test.mm in Sources */, D756A1A63E626572EE8DF592 /* firestore.pb.cc in Sources */, 8B31F63673F3B5238DE95AFB /* geo_point_test.cc in Sources */, - FC6C9D1A8B24A5C9507272F7 /* globals_cache_test.cc in Sources */, 5958E3E3A0446A88B815CB70 /* grpc_connection_test.cc in Sources */, 0C18678CE7E355B17C34F2EE /* grpc_stream_test.cc in Sources */, B83A1416C3922E2F3EBA77FE /* grpc_stream_tester.cc in Sources */, @@ -4951,7 +4915,6 @@ 4173B61CB74EB4CD1D89EE68 /* latlng.pb.cc in Sources */, 1E8F5F37052AB0C087D69DF9 /* leveldb_bundle_cache_test.cc in Sources */, 10B69419AC04F157D855FED7 /* leveldb_document_overlay_cache_test.cc in Sources */, - 5EE3552E9EFB45791F83CBED /* leveldb_globals_cache_test.cc in Sources */, 839D8B502026706419FE09D6 /* leveldb_index_manager_test.cc in Sources */, A4AD189BDEF7A609953457A6 /* leveldb_key_test.cc in Sources */, 1029F0461945A444FCB523B3 /* leveldb_local_store_test.cc in Sources */, @@ -4977,7 +4940,6 @@ E72A77095FF6814267DF0F6D /* md5_testing.cc in Sources */, 94854FAEAEA75A1AC77A0515 /* memory_bundle_cache_test.cc in Sources */, 053C11420E49AE1A77E21C20 /* memory_document_overlay_cache_test.cc in Sources */, - BA630BD416C72344416BF7D9 /* memory_globals_cache_test.cc in Sources */, 4D8367018652104A8803E8DB /* memory_index_manager_test.cc in Sources */, 91AEFFEE35FBE15FEC42A1F4 /* memory_local_store_test.cc in Sources */, 3B23E21D5D7ACF54EBD8CF67 /* memory_lru_garbage_collector_test.cc in Sources */, @@ -5165,7 +5127,6 @@ C09BDBA73261578F9DA74CEE /* firebase_auth_credentials_provider_test.mm in Sources */, 544129DB21C2DDC800EFB9CC /* firestore.pb.cc in Sources */, AB7BAB342012B519001E0872 /* geo_point_test.cc in Sources */, - 00F49125748D47336BCDFB69 /* globals_cache_test.cc in Sources */, B6D9649121544D4F00EB9CFB /* grpc_connection_test.cc in Sources */, B6BBE43121262CF400C6A53E /* grpc_stream_test.cc in Sources */, 34202A37E0B762386967AF3D /* grpc_stream_tester.cc in Sources */, @@ -5182,7 +5143,6 @@ 618BBEAE20B89AAC00B5BCE7 /* latlng.pb.cc in Sources */, 0EDFC8A6593477E1D17CDD8F /* leveldb_bundle_cache_test.cc in Sources */, E962CA641FB1312638593131 /* leveldb_document_overlay_cache_test.cc in Sources */, - 8778C1711059598070F86D3C /* leveldb_globals_cache_test.cc in Sources */, B743F4E121E879EF34536A51 /* leveldb_index_manager_test.cc in Sources */, 54995F6F205B6E12004EFFA0 /* leveldb_key_test.cc in Sources */, 04887E378B39FB86A8A5B52B /* leveldb_local_store_test.cc in Sources */, @@ -5208,7 +5168,6 @@ 723BBD713478BB26CEFA5A7D /* md5_testing.cc in Sources */, A0E1C7F5C7093A498F65C5CF /* memory_bundle_cache_test.cc in Sources */, E56EEC9DAC455E2BE77D110A /* memory_document_overlay_cache_test.cc in Sources */, - 6E6B8B8D61426E20495D9DF5 /* memory_globals_cache_test.cc in Sources */, 3B47CC43DBA24434E215B8ED /* memory_index_manager_test.cc in Sources */, C6BF529243414C53DF5F1012 /* memory_local_store_test.cc in Sources */, 72B25B2D698E4746143D5B74 /* memory_lru_garbage_collector_test.cc in Sources */, @@ -5429,7 +5388,6 @@ 58693C153EC597BC25EE9648 /* firebase_auth_credentials_provider_test.mm in Sources */, 920B6ABF76FDB3547F1CCD84 /* firestore.pb.cc in Sources */, 5FE84472E5369DA866193C45 /* geo_point_test.cc in Sources */, - C4D430E12F46F05416A66E0A /* globals_cache_test.cc in Sources */, 0DDEE9FE08845BB7CA4607DE /* grpc_connection_test.cc in Sources */, 549CEDA0519BA5F2508794E1 /* grpc_stream_test.cc in Sources */, DE50F1D39D34F867BC750957 /* grpc_stream_tester.cc in Sources */, @@ -5446,7 +5404,6 @@ 23C04A637090E438461E4E70 /* latlng.pb.cc in Sources */, 77C459976DCF7503AEE18F7F /* leveldb_bundle_cache_test.cc in Sources */, 01CF72FBF97CEB0AEFD9FAFE /* leveldb_document_overlay_cache_test.cc in Sources */, - 0FC27212D6211ECC3D1DD2A1 /* leveldb_globals_cache_test.cc in Sources */, 2C5C612B26168BA9286290AE /* leveldb_index_manager_test.cc in Sources */, 7731E564468645A4A62E2A3C /* leveldb_key_test.cc in Sources */, 380A137B785A5A6991BEDF4B /* leveldb_local_store_test.cc in Sources */, @@ -5472,7 +5429,6 @@ 1DCDED1F94EBC7F72FDBFC98 /* md5_testing.cc in Sources */, 479A392EAB42453D49435D28 /* memory_bundle_cache_test.cc in Sources */, 5CEB0E83DA68652927D2CF07 /* memory_document_overlay_cache_test.cc in Sources */, - CD76A9EBD2E7D9E9E35A04F7 /* memory_globals_cache_test.cc in Sources */, 90FE088B8FD9EC06EEED1F39 /* memory_index_manager_test.cc in Sources */, 1CC56DCA513B98CE39A6ED45 /* memory_local_store_test.cc in Sources */, 264AAB492E24318C5EEB0649 /* memory_lru_garbage_collector_test.cc in Sources */, diff --git a/Firestore/core/src/local/globals_cache.h b/Firestore/core/src/local/globals_cache.h deleted file mode 100644 index 78800470292..00000000000 --- a/Firestore/core/src/local/globals_cache.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @license - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_LOCAL_GLOBALS_CACHE_H_ -#define FIRESTORE_CORE_SRC_LOCAL_GLOBALS_CACHE_H_ - -#include "Firestore/core/src/nanopb/byte_string.h" - -using firebase::firestore::nanopb::ByteString; - -namespace firebase { -namespace firestore { -namespace local { - -/** - * General purpose cache for global values. - * - * Global state that cuts across components should be saved here. Following are - * contained herein: - * - * `sessionToken` tracks server interaction across Listen and Write streams. - * This facilitates cache synchronization and invalidation. - */ -class GlobalsCache { - public: - virtual ~GlobalsCache() = default; - - /** - * Gets session token. - */ - virtual ByteString GetSessionToken() const = 0; - - /** - * Sets session token. - */ - virtual void SetSessionToken(const ByteString& session_token) = 0; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_LOCAL_GLOBALS_CACHE_H_ diff --git a/Firestore/core/src/local/leveldb_globals_cache.cc b/Firestore/core/src/local/leveldb_globals_cache.cc deleted file mode 100644 index 366d0c811ea..00000000000 --- a/Firestore/core/src/local/leveldb_globals_cache.cc +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "Firestore/core/src/local/leveldb_globals_cache.h" -#include "Firestore/core/src/local/leveldb_key.h" -#include "Firestore/core/src/local/leveldb_persistence.h" - -namespace firebase { -namespace firestore { -namespace local { - -namespace { - -const char* kSessionToken = "session_token"; - -} - -LevelDbGlobalsCache::LevelDbGlobalsCache(LevelDbPersistence* db) - : db_(NOT_NULL(db)) { -} - -ByteString LevelDbGlobalsCache::GetSessionToken() const { - auto key = LevelDbGlobalKey::Key(kSessionToken); - - std::string encoded; - auto done = db_->current_transaction()->Get(key, &encoded); - - if (!done.ok()) { - return ByteString(); - } - - return ByteString(encoded); -} - -void LevelDbGlobalsCache::SetSessionToken(const ByteString& session_token) { - auto key = LevelDbGlobalKey::Key(kSessionToken); - db_->current_transaction()->Put(key, session_token.ToString()); -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Firestore/core/src/local/leveldb_globals_cache.h b/Firestore/core/src/local/leveldb_globals_cache.h deleted file mode 100644 index 4b41df5705e..00000000000 --- a/Firestore/core/src/local/leveldb_globals_cache.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_GLOBALS_CACHE_H_ -#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_GLOBALS_CACHE_H_ - -#include "Firestore/core/src/local/globals_cache.h" - -namespace firebase { -namespace firestore { -namespace local { - -class LevelDbPersistence; - -class LevelDbGlobalsCache : public GlobalsCache { - public: - /** Creates a new bundle cache in the given LevelDB. */ - explicit LevelDbGlobalsCache(LevelDbPersistence* db); - - /** - * Gets session token. - */ - ByteString GetSessionToken() const override; - - /** - * Sets session token. - */ - void SetSessionToken(const ByteString& session_token) override; - - private: - // The LevelDbGlobalsCache is owned by LevelDbPersistence. - LevelDbPersistence* db_ = nullptr; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_GLOBALS_CACHE_H_ diff --git a/Firestore/core/src/local/leveldb_key.cc b/Firestore/core/src/local/leveldb_key.cc index fd0fa8dacd1..e8819650df4 100644 --- a/Firestore/core/src/local/leveldb_key.cc +++ b/Firestore/core/src/local/leveldb_key.cc @@ -39,7 +39,6 @@ namespace local { namespace { const char* kVersionGlobalTable = "version"; -const char* kGlobalsTable = "globals"; const char* kMutationsTable = "mutation"; const char* kDocumentMutationsTable = "document_mutation"; const char* kMutationQueuesTable = "mutation_queue"; @@ -160,11 +159,6 @@ enum ComponentLabel { */ DataMigrationName = 25, - /** - * The name of a global. - */ - GlobalName = 26, - /** * A path segment describes just a single segment in a resource path. Path * segments that occur sequentially in a key represent successive segments in @@ -251,10 +245,6 @@ class Reader { return ReadLabeledString(ComponentLabel::BundleId); } - std::string ReadGlobalName() { - return ReadLabeledString(ComponentLabel::GlobalName); - } - std::string ReadQueryName() { return ReadLabeledString(ComponentLabel::QueryName); } @@ -728,10 +718,6 @@ class Writer { WriteLabeledString(ComponentLabel::TableName, table_name); } - void WriteGlobalName(absl::string_view global_name) { - WriteLabeledString(ComponentLabel::GlobalName, global_name); - } - void WriteBatchId(model::BatchId batch_id) { WriteLabeledInt32(ComponentLabel::BatchId, batch_id); } @@ -1220,28 +1206,6 @@ bool LevelDbRemoteDocumentReadTimeKey::Decode(absl::string_view key) { return reader.ok(); } -std::string LevelDbGlobalKey::KeyPrefix() { - Writer writer; - writer.WriteTableName(kGlobalsTable); - return writer.result(); -} - -std::string LevelDbGlobalKey::Key(absl::string_view global_name) { - Writer writer; - writer.WriteTableName(kGlobalsTable); - writer.WriteGlobalName(global_name); - writer.WriteTerminator(); - return writer.result(); -} - -bool LevelDbGlobalKey::Decode(absl::string_view key) { - Reader reader{key}; - reader.ReadTableNameMatching(kGlobalsTable); - global_name_ = reader.ReadGlobalName(); - reader.ReadTerminator(); - return reader.ok(); -} - std::string LevelDbBundleKey::KeyPrefix() { Writer writer; writer.WriteTableName(kBundlesTable); diff --git a/Firestore/core/src/local/leveldb_key.h b/Firestore/core/src/local/leveldb_key.h index 14ecd809ea2..51505b9c5c6 100644 --- a/Firestore/core/src/local/leveldb_key.h +++ b/Firestore/core/src/local/leveldb_key.h @@ -768,41 +768,6 @@ class LevelDbNamedQueryKey { std::string name_; }; -/** - * A key in the globals table, storing the name of the global value. - */ -class LevelDbGlobalKey { - public: - /** - * Creates a key prefix that points just before the first key of the table. - */ - static std::string KeyPrefix(); - - /** - * Creates a key that points to the key for the given name of global value. - */ - static std::string Key(absl::string_view global_name); - - /** - * Decodes the given complete key, storing the decoded values in this - * instance. - * - * @return true if the key successfully decoded, false otherwise. If false is - * returned, this instance is in an undefined state until the next call to - * `Decode()`. - */ - ABSL_MUST_USE_RESULT - bool Decode(absl::string_view key); - - /** The name that serves as identifier for global value for this entry. */ - const std::string& global_name() const { - return global_name_; - } - - private: - std::string global_name_; -}; - /** * A key in the index_configuration table, storing the index definition proto, * and the collection (group) it applies to. diff --git a/Firestore/core/src/local/leveldb_persistence.cc b/Firestore/core/src/local/leveldb_persistence.cc index 9725e267356..c5ce4c60c2d 100644 --- a/Firestore/core/src/local/leveldb_persistence.cc +++ b/Firestore/core/src/local/leveldb_persistence.cc @@ -126,7 +126,6 @@ LevelDbPersistence::LevelDbPersistence(std::unique_ptr db, reference_delegate_ = absl::make_unique(this, lru_params); bundle_cache_ = absl::make_unique(this, &serializer_); - globals_cache_ = absl::make_unique(this); // TODO(gsoltis): set up a leveldb transaction for these operations. target_cache_->Start(); @@ -251,10 +250,6 @@ LevelDbTargetCache* LevelDbPersistence::target_cache() { return target_cache_.get(); } -LevelDbGlobalsCache* LevelDbPersistence::globals_cache() { - return globals_cache_.get(); -} - LevelDbRemoteDocumentCache* LevelDbPersistence::remote_document_cache() { return document_cache_.get(); } diff --git a/Firestore/core/src/local/leveldb_persistence.h b/Firestore/core/src/local/leveldb_persistence.h index 5ca6491bccd..1374d91a08e 100644 --- a/Firestore/core/src/local/leveldb_persistence.h +++ b/Firestore/core/src/local/leveldb_persistence.h @@ -25,7 +25,6 @@ #include "Firestore/core/src/credentials/user.h" #include "Firestore/core/src/local/leveldb_bundle_cache.h" #include "Firestore/core/src/local/leveldb_document_overlay_cache.h" -#include "Firestore/core/src/local/leveldb_globals_cache.h" #include "Firestore/core/src/local/leveldb_index_manager.h" #include "Firestore/core/src/local/leveldb_lru_reference_delegate.h" #include "Firestore/core/src/local/leveldb_migrations.h" @@ -85,8 +84,6 @@ class LevelDbPersistence : public Persistence { LevelDbBundleCache* bundle_cache() override; - LevelDbGlobalsCache* globals_cache() override; - LevelDbDocumentOverlayCache* GetDocumentOverlayCache( const credentials::User& user) override; LevelDbOverlayMigrationManager* GetOverlayMigrationManager( @@ -157,7 +154,6 @@ class LevelDbPersistence : public Persistence { bool started_ = false; std::unique_ptr bundle_cache_; - std::unique_ptr globals_cache_; std::unordered_map> document_overlay_caches_; std::unordered_map - -#include "Firestore/core/src/local/globals_cache.h" - -namespace firebase { -namespace firestore { -namespace local { - -class MemoryGlobalsCache : public GlobalsCache { - public: - /** - * Gets session token. - */ - ByteString GetSessionToken() const override; - - /** - * Sets session token. - */ - void SetSessionToken(const ByteString& session_token) override; - - private: - ByteString session_token_; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_GLOBALS_CACHE_H_ diff --git a/Firestore/core/src/local/memory_persistence.cc b/Firestore/core/src/local/memory_persistence.cc index f1946661ba5..009036e1d8b 100644 --- a/Firestore/core/src/local/memory_persistence.cc +++ b/Firestore/core/src/local/memory_persistence.cc @@ -102,10 +102,6 @@ MemoryBundleCache* MemoryPersistence::bundle_cache() { return &bundle_cache_; } -MemoryGlobalsCache* MemoryPersistence::globals_cache() { - return &globals_cache_; -} - MemoryDocumentOverlayCache* MemoryPersistence::GetDocumentOverlayCache( const User& user) { auto iter = document_overlay_caches_.find(user); diff --git a/Firestore/core/src/local/memory_persistence.h b/Firestore/core/src/local/memory_persistence.h index bebadb86790..674577bbac2 100644 --- a/Firestore/core/src/local/memory_persistence.h +++ b/Firestore/core/src/local/memory_persistence.h @@ -27,7 +27,6 @@ #include "Firestore/core/src/credentials/user.h" #include "Firestore/core/src/local/memory_bundle_cache.h" #include "Firestore/core/src/local/memory_document_overlay_cache.h" -#include "Firestore/core/src/local/memory_globals_cache.h" #include "Firestore/core/src/local/memory_index_manager.h" #include "Firestore/core/src/local/memory_mutation_queue.h" #include "Firestore/core/src/local/memory_remote_document_cache.h" @@ -91,8 +90,6 @@ class MemoryPersistence : public Persistence { MemoryBundleCache* bundle_cache() override; - MemoryGlobalsCache* globals_cache() override; - MemoryDocumentOverlayCache* GetDocumentOverlayCache( const credentials::User& user) override; @@ -141,8 +138,6 @@ class MemoryPersistence : public Persistence { MemoryBundleCache bundle_cache_; - MemoryGlobalsCache globals_cache_; - DocumentOverlayCaches document_overlay_caches_; MemoryOverlayMigrationManager overlay_migration_manager_; diff --git a/Firestore/core/src/local/persistence.h b/Firestore/core/src/local/persistence.h index 3e184e4bac8..b1f7ebde74f 100644 --- a/Firestore/core/src/local/persistence.h +++ b/Firestore/core/src/local/persistence.h @@ -36,7 +36,6 @@ namespace local { class BundleCache; class DocumentOverlayCache; -class GlobalsCache; class IndexManager; class MutationQueue; class OverlayMigrationManager; @@ -87,11 +86,6 @@ class Persistence { /** Releases any resources held during eager shutdown. */ virtual void Shutdown() = 0; - /** - * Returns GlobalCache representing a general purpose cache for global values. - */ - virtual GlobalsCache* globals_cache() = 0; - /** * Returns a MutationQueue representing the persisted mutations for the given * user. diff --git a/Firestore/core/test/unit/local/globals_cache_test.cc b/Firestore/core/test/unit/local/globals_cache_test.cc deleted file mode 100644 index 0945a3a7b35..00000000000 --- a/Firestore/core/test/unit/local/globals_cache_test.cc +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/test/unit/local/globals_cache_test.h" - -#include "Firestore/core/src/local/globals_cache.h" -#include "Firestore/core/src/local/persistence.h" -#include "Firestore/core/test/unit/testutil/testutil.h" -#include "gtest/gtest.h" - -namespace firebase { -namespace firestore { - -using util::ComparisonResult; - -namespace local { - -GlobalsCacheTest::GlobalsCacheTest(std::unique_ptr persistence) - : persistence_(std::move(NOT_NULL(persistence))), - cache_(persistence_->globals_cache()) { -} - -GlobalsCacheTest::GlobalsCacheTest() : GlobalsCacheTest(GetParam()()) { -} - -namespace { - -TEST_P(GlobalsCacheTest, ReturnsEmptyBytestringWhenSessionTokenNotFound) { - persistence_->Run( - "test_returns_empty_bytestring_when_session_token_not_found", [&] { - auto expected = ByteString(); - EXPECT_EQ(cache_->GetSessionToken().CompareTo(expected), - ComparisonResult::Same); - }); -} - -TEST_P(GlobalsCacheTest, ReturnsSavedSessionToken) { - persistence_->Run("test_returns_saved_session_token", [&] { - auto expected = ByteString("magic"); - cache_->SetSessionToken(expected); - - EXPECT_EQ(cache_->GetSessionToken().CompareTo(expected), - ComparisonResult::Same); - - // Overwrite - expected = ByteString("science"); - cache_->SetSessionToken(expected); - - EXPECT_EQ(cache_->GetSessionToken().CompareTo(expected), - ComparisonResult::Same); - }); -} - -} // namespace - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Firestore/core/test/unit/local/globals_cache_test.h b/Firestore/core/test/unit/local/globals_cache_test.h deleted file mode 100644 index aad64844339..00000000000 --- a/Firestore/core/test/unit/local/globals_cache_test.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_TEST_UNIT_LOCAL_GLOBALS_CACHE_TEST_H_ -#define FIRESTORE_CORE_TEST_UNIT_LOCAL_GLOBALS_CACHE_TEST_H_ - -#include - -#include "gtest/gtest.h" - -namespace firebase { -namespace firestore { -namespace local { - -class Persistence; -class GlobalsCache; - -using FactoryFunc = std::unique_ptr (*)(); - -/** - * These are tests for any implementation of the GlobalsCache interface. - * - * To test a specific implementation of GlobalsCache: - * - * - Write a persistence factory function - * - Call INSTANTIATE_TEST_SUITE_P(MyNewGlobalsCacheTest, - * GlobalsCacheTest, - * testing::Values(PersistenceFactory)); - */ -class GlobalsCacheTest : public testing::Test, - public testing::WithParamInterface { - public: - GlobalsCacheTest(); - explicit GlobalsCacheTest(std::unique_ptr persistence); - ~GlobalsCacheTest() = default; - - protected: - std::unique_ptr persistence_; - GlobalsCache* cache_ = nullptr; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_TEST_UNIT_LOCAL_GLOBALS_CACHE_TEST_H_ diff --git a/Firestore/core/test/unit/local/leveldb_globals_cache_test.cc b/Firestore/core/test/unit/local/leveldb_globals_cache_test.cc deleted file mode 100644 index 4b6f11e5a48..00000000000 --- a/Firestore/core/test/unit/local/leveldb_globals_cache_test.cc +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/local/leveldb_persistence.h" -#include "Firestore/core/test/unit/local/globals_cache_test.h" -#include "Firestore/core/test/unit/local/persistence_testing.h" - -namespace firebase { -namespace firestore { -namespace local { -namespace { - -std::unique_ptr PersistenceFactory() { - return LevelDbPersistenceForTesting(); -} - -} // namespace - -INSTANTIATE_TEST_SUITE_P(LevelDbGlobalsCacheTest, - GlobalsCacheTest, - testing::Values(PersistenceFactory)); - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Firestore/core/test/unit/local/memory_globals_cache_test.cc b/Firestore/core/test/unit/local/memory_globals_cache_test.cc deleted file mode 100644 index e3bcde58d96..00000000000 --- a/Firestore/core/test/unit/local/memory_globals_cache_test.cc +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/local/memory_persistence.h" -#include "Firestore/core/test/unit/local/globals_cache_test.h" -#include "Firestore/core/test/unit/local/persistence_testing.h" - -namespace firebase { -namespace firestore { -namespace local { -namespace { - -std::unique_ptr PersistenceFactory() { - return MemoryPersistenceWithEagerGcForTesting(); -} - -} // namespace - -INSTANTIATE_TEST_SUITE_P(MemoryGloablsCacheTest, - GlobalsCacheTest, - testing::Values(PersistenceFactory)); - -} // namespace local -} // namespace firestore -} // namespace firebase From ca6ea18bad87718c8fe5650f796a5a9e6b13f62f Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Wed, 25 Sep 2024 09:30:29 -0700 Subject: [PATCH 12/13] Revert "[Messaging] Prep #13691 (#13720) --- FirebaseMessaging/Sources/FIRMessaging.m | 7 ------- .../Sources/Public/FirebaseMessaging/FIRMessaging.h | 4 ---- .../Sources/Public/FirebaseMessaging/FirebaseMessaging.h | 2 -- 3 files changed, 13 deletions(-) diff --git a/FirebaseMessaging/Sources/FIRMessaging.m b/FirebaseMessaging/Sources/FIRMessaging.m index 6f160682e0a..af18ea77fea 100644 --- a/FirebaseMessaging/Sources/FIRMessaging.m +++ b/FirebaseMessaging/Sources/FIRMessaging.m @@ -40,10 +40,7 @@ #import "FirebaseMessaging/Sources/FIRMessagingUtilities.h" #import "FirebaseMessaging/Sources/FIRMessaging_Private.h" #import "FirebaseMessaging/Sources/NSError+FIRMessaging.h" -#if __has_include( \ - "FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h") #import "FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h" -#endif // __has_include("FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h") #import "FirebaseMessaging/Sources/Token/FIRMessagingAuthService.h" #import "FirebaseMessaging/Sources/Token/FIRMessagingTokenInfo.h" #import "FirebaseMessaging/Sources/Token/FIRMessagingTokenManager.h" @@ -134,8 +131,6 @@ + (FIRMessaging *)messaging { return (FIRMessaging *)instance; } -#if __has_include( \ - "FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h") + (FIRMessagingExtensionHelper *)extensionHelper { static dispatch_once_t once; static FIRMessagingExtensionHelper *extensionHelper; @@ -144,8 +139,6 @@ + (FIRMessagingExtensionHelper *)extensionHelper { }); return extensionHelper; } -#endif // __has_include("FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessagingExtensionHelper.h") - - (instancetype)initWithAnalytics:(nullable id)analytics userDefaults:(GULUserDefaults *)defaults heartbeatLogger:(FIRHeartbeatLogger *)heartbeatLogger { diff --git a/FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessaging.h b/FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessaging.h index 5a7243cbacc..4f5209bb935 100644 --- a/FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessaging.h +++ b/FirebaseMessaging/Sources/Public/FirebaseMessaging/FIRMessaging.h @@ -136,9 +136,7 @@ NS_SWIFT_NAME(MessagingMessageInfo) @end @class FIRMessaging; -#if __has_include("FIRMessagingExtensionHelper.h") @class FIRMessagingExtensionHelper; -#endif // __has_include("FIRMessagingExtensionHelper.h") /** * A protocol to handle token update or data message delivery from FCM. @@ -186,7 +184,6 @@ NS_SWIFT_NAME(Messaging) */ + (instancetype)messaging NS_SWIFT_NAME(messaging()); -#if __has_include("FIRMessagingExtensionHelper.h") /** * Use the MessagingExtensionHelper to populate rich UI content for your notifications. * For example, if an image URL is set in your notification payload or on the console, @@ -197,7 +194,6 @@ NS_SWIFT_NAME(Messaging) */ + (FIRMessagingExtensionHelper *)extensionHelper NS_SWIFT_NAME(serviceExtension()) NS_AVAILABLE(10.14, 10.0); -#endif // __has_include("FIRMessagingExtensionHelper.h") /** * Unavailable. Use +messaging instead. diff --git a/FirebaseMessaging/Sources/Public/FirebaseMessaging/FirebaseMessaging.h b/FirebaseMessaging/Sources/Public/FirebaseMessaging/FirebaseMessaging.h index a46524b399c..c5d0bd05046 100755 --- a/FirebaseMessaging/Sources/Public/FirebaseMessaging/FirebaseMessaging.h +++ b/FirebaseMessaging/Sources/Public/FirebaseMessaging/FirebaseMessaging.h @@ -15,6 +15,4 @@ */ #import "FIRMessaging.h" -#if __has_include("FIRMessagingExtensionHelper.h") #import "FIRMessagingExtensionHelper.h" -#endif // __has_include("FIRMessagingExtensionHelper.h") From f909f901bfba9e27e4e9da83242a4915d6dd64bb Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Thu, 26 Sep 2024 18:02:23 -0700 Subject: [PATCH 13/13] Firestore SPM binary for 11.3.0 (#13730) --- Package.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index ce9d632e330..86d77b45682 100644 --- a/Package.swift +++ b/Package.swift @@ -1511,8 +1511,8 @@ func firestoreTargets() -> [Target] { } else { return .binaryTarget( name: "FirebaseFirestoreInternal", - url: "https://dl.google.com/firebase/ios/bin/firestore/11.2.0/rc0/FirebaseFirestoreInternal.zip", - checksum: "821acae8d3b79c6d35539d87926da8aeae4a63878bec2987b01cb885b5120df2" + url: "https://dl.google.com/firebase/ios/bin/firestore/11.3.0/rc0/FirebaseFirestoreInternal.zip", + checksum: "214f91ae3ad87fce55155ea3e6dacda4f237e703ea3935353c7c6819eddb1c17" ) } }()