dataconnect(change): Added internal logic: DataConnectGrpcRPCs.connect() to open a bidi streaming connection for realtime query updates#8141
Conversation
…sDataConnectGrpcStreamingServer.kt and TurbineUtils.kt This enables these classes to be used from both `androidTest` to `test` (thanks to the `@SharedWithAndroidTest` annotation and the associated gradle plugin) instead of just in `androidTest`. A future test will make use of this.
… streaming connection with the backend for realtime queries.
…le(): T` (moved from ConnectRPCIntegrationTest.kt)
…ic tests for DataConnectGrpcRPCs.connect()
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements a bidirectional gRPC connection for real-time query results, introducing the DataConnectBidiConnectStream class to manage multiplexed requests and responses. Key changes include the addition of a connect method in DataConnectGrpcRPCs, lifecycle management for the stream, and comprehensive integration and unit tests. Feedback highlights a high-severity bug in an integration test assertion that compares a list to itself and a potential resource leak where the outgoingRequests channel remains open after a gRPC connection failure.
…ared errors with itself instead of with the expected list [skip actions]
…sts if ConnectorStreamServiceCoroutineStub.connect() throws an exception
Added internal logic to support bidirectional streaming connections for realtime query updates in Firebase Data Connect. This includes the implementation of the
DataConnectGrpcRPCs.connect()method and theDataConnectBidiConnectStreamclass for managing stream lifecycles and subscriptions.Highlights
DataConnectBidiConnectStreamto manage the lifecycle, message multiplexing, and error handling of bidirectional gRPC streams.DataConnectGrpcRPCswith a newconnect()method to initialize streaming connections with the backend, including proper metadata and authentication handling.Changelog
Modified Files
sample()extension function.connect()method and added support for streaming gRPC stubs.connect()method.connect()logic and updated existing tests to use a consistentRandomSource.sample()extension function forArb.DataConnectGrpcRPCs.testutilfor shared use between unit and integration tests.testutilfor shared use.grpc-apiandturbinedependencies.streamId()arbitrary for testing.turbinetotestImplementation.grpc-apiandturbinedependencies.