Skip to content

dataconnect(chore): wire up RealtimeQuerySubscriptionImpl to basic realtime subscription functionality#8144

Merged
dconeybe merged 22 commits into
mainfrom
dconeybe/dataconnect/RealtimeRewire2
May 13, 2026
Merged

dataconnect(chore): wire up RealtimeQuerySubscriptionImpl to basic realtime subscription functionality#8144
dconeybe merged 22 commits into
mainfrom
dconeybe/dataconnect/RealtimeRewire2

Conversation

@dconeybe
Copy link
Copy Markdown
Contributor

@dconeybe dconeybe commented May 12, 2026

This PR wires up RealtimeQuerySubscriptionImpl to basic realtime subscription functionality in the Data Connect SDK, enabling experimental support for realtime query updates.

Highlights

  • Added ExperimentalRealtimeQueries annotation to mark the new experimental feature.
  • Implemented RealtimeQueryRefImpl and RealtimeQuerySubscriptionImpl to handle realtime query subscriptions.
  • Added connect method to DataConnectGrpcClient to handle the bidirectional streaming connection for realtime updates.
  • Added integration tests in RealtimeQueryRefIntegrationTest to verify the behavior of emitted results.

Changelog

File changes
  • DataConnectGrpcRPCsConnectIntegrationTest.kt: Opted in to ExperimentalRealtimeQueries.
  • RealtimeQueryRefIntegrationTest.kt: Added integration tests for realtimeQuery.
  • FirebaseDataConnectInternalExts.kt: Added realtimeQuery extension helper.
  • RealtimeConnector.kt: Added getInstance and Data constructor.
  • ExperimentalRealtimeQueries.kt: Created annotation for experimental realtime queries.
  • DataConnectBidiConnectStream.kt: Updated stream handling and added annotation.
  • DataConnectGrpcClient.kt: Added connect method for streaming responses.
  • DataConnectGrpcRPCs.kt: Added annotation to connect.
  • FirebaseDataConnectImpl.kt: Implemented realtimeQuery method.
  • RealtimeQueryRefImpl.kt: Created temporary implementation for realtime QueryRef.
  • RealtimeQuerySubscriptionImpl.kt: Created temporary implementation for realtime QuerySubscription.
  • DataConnectGrpcRPCsUnitTest.kt: Opted in to ExperimentalRealtimeQueries.

dconeybe added 15 commits May 11, 2026 18:02
…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)
…ared errors with itself instead of with the expected list [skip actions]
…sts if ConnectorStreamServiceCoroutineStub.connect() throws an exception
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

@dconeybe
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the experimental "realtime query subscription updates" feature to the Firebase Data Connect SDK. Key additions include the ExperimentalRealtimeQueries annotation, a realtimeQuery method in the internal interface and implementation, and the RealtimeQueryRefImpl and RealtimeQuerySubscriptionImpl classes to manage bidirectional streaming via DataConnectGrpcClient. Integration tests were also added to verify the properties and data of emitted results. Feedback from the review suggests improving coroutine cancellation handling by explicitly rethrowing CancellationException, updating documentation comments for accuracy regarding excluded characters in request IDs, and adding tracking bug references to TODO markers.

@dconeybe dconeybe marked this pull request as ready for review May 12, 2026 15:36
aashishpatil-g
aashishpatil-g previously approved these changes May 12, 2026
@dconeybe dconeybe requested a review from aashishpatil-g May 12, 2026 21:26
Base automatically changed from dconeybe/dataconnect/DataConnectSerialization to main May 12, 2026 22:37
@dconeybe dconeybe dismissed aashishpatil-g’s stale review May 12, 2026 22:37

The base branch was changed.

@github-actions
Copy link
Copy Markdown
Contributor

📝 PRs merging into main branch

Our 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.

@dconeybe dconeybe merged commit c97fcf5 into main May 13, 2026
48 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/RealtimeRewire2 branch May 13, 2026 15:14
@github-actions github-actions Bot mentioned this pull request May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants