Add AsyncStream support for Remote Config#15352
Merged
peterfriese merged 19 commits intomainfrom Mar 31, 2026
Merged
Conversation
paulb777
reviewed
Sep 23, 2025
Member
paulb777
left a comment
There was a problem hiding this comment.
LGTM - thanks @peterfriese !
Leaving approval to @ncooke3 or the RC team
ncooke3
reviewed
Sep 23, 2025
ncooke3
reviewed
Sep 24, 2025
ncooke3
reviewed
Sep 24, 2025
ncooke3
approved these changes
Sep 24, 2025
paulb777
approved these changes
Sep 29, 2025
Member
|
Closing and re-opening to trigger all CI checks again. |
ncooke3
reviewed
Oct 2, 2025
ncooke3
reviewed
Oct 2, 2025
ncooke3
reviewed
Oct 2, 2025
ncooke3
reviewed
Oct 2, 2025
ncooke3
approved these changes
Oct 2, 2025
Member
ncooke3
left a comment
There was a problem hiding this comment.
Left some suggestions to fix current CI errors. Also suggesting to change doc comment and changelog to prefer sequence over stream (impl. detail).
Member
|
Down to one linting failure (unit test flake?). Rerunning: |
Member
Perhaps not a flake. Going to see how to surface which test this is coming from. |
Member
|
I haven't been able to reproduce: Testing started
-> FirebaseRemoteConfig (12.4.0)
- NOTE | xcodebuild: note: Using codesigning identity override: -
- NOTE | xcodebuild: note: Building targets in dependency order
- NOTE | [iOS] xcodebuild: note: Target dependency graph (18 targets)
- NOTE | xcodebuild: note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target 'FirebaseSharedSwift' from project 'Pods')
- NOTE | xcodebuild: note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target 'FirebaseRemoteConfigInterop' from project 'Pods')
- NOTE | xcodebuild: note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target 'FirebaseCoreInternal' from project 'Pods')
- NOTE | xcodebuild: note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target 'FirebaseRemoteConfig' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Signing static framework with --generate-pre-encrypt-hashes (in target 'Pods-App' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target 'App' from project 'App')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'App' from project 'App')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'Pods-App' from project 'Pods')
- NOTE | xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.2.99. (in target 'PromisesObjC' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'PromisesObjC' from project 'Pods')
- NOTE | xcodebuild: Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.2.99. (in target 'PromisesObjC-FBLPromises_Privacy' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'PromisesObjC-FBLPromises_Privacy' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'GoogleUtilities-GoogleUtilities_Privacy' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'GoogleUtilities' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseSharedSwift' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseRemoteConfigInterop' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseRemoteConfig-FirebaseRemoteConfig_Privacy' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseRemoteConfig' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseInstallations-FirebaseInstallations_Privacy' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseInstallations' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCoreInternal-FirebaseCoreInternal_Privacy' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCoreInternal' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCore-FirebaseCore_Privacy' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCore' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseABTesting-FirebaseABTesting_Privacy' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseABTesting' from project 'Pods')
- NOTE | xcodebuild: note: Target dependency graph (19 targets)
- NOTE | xcodebuild: note: Using stub executor library without Swift entry point. (in target 'AppHost-FirebaseRemoteConfig-Unit-Tests' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target 'FirebaseRemoteConfig-Unit-unit' from project 'Pods')
- NOTE | [iOS] xcodebuild: The server responded with an error:
- NOTE | [iOS] xcodebuild: 2025-10-03 10:15:06.050224-0400 AppHost-FirebaseRemoteConfig-Unit-Tests[52071:8570339] [[FirebaseRemoteConfig]] 12.4.0 - [FirebaseRemoteConfig][I-RCN000073] Failed to get installations token. Error : Error Domain=com.firebase.installations Code=0 "The server responded with an error:
- NOTE | [iOS] xcodebuild: " UserInfo={NSLocalizedFailureReason=The server responded with an error:
- NOTE | [iOS] xcodebuild: note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target 'FirebaseRemoteConfig-Unit-swift-api-tests' from project 'Pods')
- NOTE | [iOS] xcodebuild: note: Metadata extraction skipped. No AppIntents.framework dependency found. (in target 'FirebaseRemoteConfig-Unit-fake-console-tests' from project 'Pods')
FirebaseRemoteConfig passed validation.
nickcooke@nickcooke-mac2 firebase (peterfriese/asyncsequences/remoteconfig) % xcode-select -p
/Applications/Xcode_16.2.app/Contents/Developer |
Member
|
Should be OK to ignore, I verified that the new test suite you added is running and passing. |
66f5df1 to
7a321e3
Compare
peterfriese
added a commit
that referenced
this pull request
Mar 31, 2026
Introduces `AsyncSequence` support for `Query.snapshots` and `DocumentReference.snapshots`, enabling developers to handle Firestore real-time updates using Swift's structured concurrency. - Provides a modern, async-await compatible alternative to `addSnapshotListener`. - Supports both `Query` and `DocumentReference` snapshot streams. - Automatically handles listener registration and cleanup on task cancellation. - Configured with an unbounded buffering policy to ensure no snapshot events are lost. This work follows similar patterns introduced for Firebase Auth and Remote Config, bringing consistency to the developer experience across the Firebase Apple SDKs. Related Projects: - Firebase Auth AsyncSequence (#15362) - Remote Config AsyncSequence (#15352) Public API: - `DocumentReference.snapshots(includeMetadataChanges:) -> DocumentSnapshotsSequence` - `Query.snapshots(includeMetadataChanges:) -> QuerySnapshotsSequence` Tested on iOS, macOS, tvOS, and watchOS. Signed-off-by: Peter Friese <peter@peterfriese.dev> Co-authored-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
Co-authored-by: Nick Cooke <36927374+ncooke3@users.noreply.github.com>
…the naming scheme
Removed performance-tuning attributes and Sendable conformances to match the established SDK patterns. Retained the 2025 copyright year.
7a321e3 to
7c62aea
Compare
ncooke3
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new
configUpdatesproperty to RemoteConfig, providing anAsyncThrowingStreamfor consuming real-time config updates. This offers a modern, Swift Concurrency-native alternative to the existing closure-based listener, making it easier to integrate real-time updates into async/await workflows.Motivation
The existing
addOnConfigUpdateListeneruses a closure-based callback, which can be cumbersome in modern Swift applications that have adopted Swift Concurrency. By providing anAsyncThrowingStream, we offer a more ergonomic and idiomatic way for developers to receive real-time updates, simplifying their code and improving readability.Implementation Details
FirebaseRemoteConfig/Swift/RemoteConfig+Async.swift: A new file containing an extension on RemoteConfig.FirebaseRemoteConfig/Tests/Swift/SwiftAPI/AsyncStreamTests.swift: A new test suite for the async stream functionality.Example usage
Developers can now listen for real-time updates using a simple for try await loop:
This change is purely additive and does not affect any existing APIs.
Fix #14539